Sep 9, 2009 at 1:13pm
Hay!
So im trying to create a simple text-based game with c++, i have got verry good results so far, but i dont understand how to do the yes/no thingy
im trying to do this:
char yesorno;
cout<< "blahblahblah, (Y/N)";
cin>> yesorno;
if(yesorno == "n")
{
do
//blahblahblah
}
until(yesorno == "y")
And when i try to compile it sais:
ISO c++ forbids comparison between pointer and integer
can someone tell me how to fix this?
Last edited on Sep 9, 2009 at 1:13pm
Sep 9, 2009 at 1:38pm
Characters are placed in single quotes. if( yesorno == 'n' )
Sep 9, 2009 at 1:50pm
omg thank you THANK YOU!!!!!
Sep 10, 2009 at 5:28pm
Or you could use strings...
Sep 10, 2009 at 6:46pm
this thread whent over to hear: http://www.cplusplus.com/forum/beginner/14176/