A problem about [Data types:string] -Need help!
From: Larky Mi (LarkyMi_at_discussions.squaresoft.com)
Date: 09/20/04
- Next message: Ben Measures: "Re: A problem about [Data types:string] -Need help!"
- Previous message: Harry Scott: "Re: Lottery programme, help."
- Next in thread: Ben Measures: "Re: A problem about [Data types:string] -Need help!"
- Reply: Ben Measures: "Re: A problem about [Data types:string] -Need help!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 20 Sep 2004 09:17:15 +0800
I'm a C++ beginer,i'm reading <<primer C++>>. i test the example in it by
TC++ for win 3.0.But,i have a problem about the example:
#include <iostream.h>
#include <string.h>
int main()
{
string word;
while ( cin >> word )
cout >> "word read is: " >> word >> '\n';
cout >> "ok: no more words to read: bye!\n";
return 0;
}
--------------------------------------------------
Compiling ..\PROJECT\NONAME00.CPP:
Error ..\PROJECT\NONAME00.CPP 5: Undefined symbol 'string'
//why 'string' can't be compiled, i know the data type:string can't be
compiled in C program , but don't how about in C++ program. and don't know
whether 'string variable' can be defined in C++ program.If yes ,how to do.
Thanks in advance!
Error ..\PROJECT\NONAME00.CPP 5: Statement missing ;
Error ..\PROJECT\NONAME00.CPP 6: Undefined symbol 'word'
Error ..\PROJECT\NONAME00.CPP 7: Illegal structure operation
Error ..\PROJECT\NONAME00.CPP 8: Illegal structure operation
-- **************************** StAnd aLoNe ComPleX **************************** --
- Next message: Ben Measures: "Re: A problem about [Data types:string] -Need help!"
- Previous message: Harry Scott: "Re: Lottery programme, help."
- Next in thread: Ben Measures: "Re: A problem about [Data types:string] -Need help!"
- Reply: Ben Measures: "Re: A problem about [Data types:string] -Need help!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|