| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
I wrote out a simple game trying practice and I came up with the strangest problem that I can't seem to debug.
It's probably just because I don't understand the error. Can anyone help? Code section with error: --------------------------------------------------------------- bool intro(void) { cout<< "Brave Knight!!! What is your name? \n"; IN(name); //line 36 cout<<"We are in need of your help "<< name <<", our village is being over run \nby " //line 38 <<"the Goblins of the Northern Caves. Will " <<" you help us? \n \n"; cout<< "1) Yes \n" << "2) No \n \n"; int response; IN(response); return !(response == 1, "of course my children"); } ------------------------------------------------------------- Error Messages: ------------------------------------------------------------- C:\Documents and Settings\Kevin\My Documents\Programming\Hello\CaveGame.cpp(36) : error C2679: binary '>>' : no operator defined which takes a right-hand operand of type 'class std::basic_string<char,struct std::char_traits<char>,class std::allocato r<char> >' (or there is no acceptable conversion) C:\Documents and Settings\Kevin\My Documents\Programming\Hello\CaveGame.cpp(38) : error C2679: binary '<<' : no operator defined which takes a right-hand operand of type 'class std::basic_string<char,struct std::char_traits<char>,class std::allocato r<char> >' (or there is no acceptable conversion) Error executing cl.exe. -------------------------------------------------------------- Can anyone help? Last edited by Frequency : June 12th, 2004 at 03:57 PM. Reason: incorrect commenting sytax |
|
#2
|
|||
|
|||
|
ive never seen the --line 36 type of code before in the middle of a cout statement. what are you trying to do?
|
|
#3
|
|||
|
|||
|
oops I suppose I should have written it as a comment...what it was supposed to be. I apologize for that.
I've fixed the code and that's what it should look like now. |
|
#4
|
|||
|
|||
|
did you try to re-compile it?
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > C/C++ Help > Function Troubles... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|