C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old June 11th, 2004, 06:29 PM
Frequency Frequency is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 3 Frequency User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Function Troubles...

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

Reply With Quote
  #2  
Old June 11th, 2004, 10:13 PM
drizzle drizzle is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Location: OREGON
Posts: 24 drizzle User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
ive never seen the --line 36 type of code before in the middle of a cout statement. what are you trying to do?

Reply With Quote
  #3  
Old June 12th, 2004, 03:56 PM
Frequency Frequency is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 3 Frequency User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #4  
Old June 13th, 2004, 09:04 PM
drizzle drizzle is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Location: OREGON
Posts: 24 drizzle User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
did you try to re-compile it?

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > Function Troubles...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway