GIDForums  

Go Back   GIDForums > Computer Programming Forums > CPP / C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 03-Oct-2003, 10:06
§tudent §tudent is offline
New Member
 
Join Date: Oct 2003
Posts: 1
§tudent is an unknown quantity at this point

C++ question


I'm in my begginning class of C++. Can someone please tell me how to delcare a string "consumer".


Thanks in advance
  #2  
Old 03-Oct-2003, 14:19
calculus87's Avatar
calculus87 calculus87 is offline
Junior Member
 
Join Date: Sep 2003
Location: FLorida
Posts: 41
calculus87 is on a distinguished road
CPP / C++ / C Code:
#include <iostream>
using namespace std;
#include <string>

int main()
{
string name;
name="consumer";
}
__________________
This message is a natural product made from recycled electrons. The slight
variations in spelling and grammar enhance its individual character and
beauty and in no way are to be considered flaws or defects.
  #3  
Old 03-Mar-2005, 21:32
karthikeyansen karthikeyansen is offline
Awaiting Email Confirmation
 
Join Date: Mar 2005
Location: INDIA
Posts: 22
karthikeyansen is on a distinguished road

Arrays or pointers


char *name = "consumer";

or

char name[9] = "consumer"; // Always add one with the string length to accomodate NULL character
 
 

Recent GIDBlog2nd Week of IA Training by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
video editing question Kris Computer Software Forum - Windows 8 13-Apr-2005 18:22
a C input question.. tmike C Programming Language 2 19-Sep-2003 02:39
a C input question tmike C Programming Language 1 16-Sep-2003 02:31
a noobish compiler question Charunks CPP / C++ Forum 5 03-Sep-2003 02:18
Mozilla TARGET question nickbeee Web Design Forum 2 03-Aug-2002 03:57

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 19:16.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.