#1
I'm making a text based game in C++ for my term project this year, can someone help me with switch cases and do while loops?
#3
switch(menu)
{
case 1:
DO STUFF;
break;
case 2:
DO STUFF;
break;
default:
Do Stuff if nothing else worked;
break;
}

Some notes:
menu, is any variable that you want, for this i used an int named 'menu'.
when menu == 1 then case 1 executes, when menu ==2 then case 2 executes, when menu != 1 or menu != 2 then default executes. You don't need default, but it is safe programming practice in case you receive an input that does fit, it wont act funky. Good luck.

Originally Posted by danzig-_-
just don't jack off too much or it'll be curved.


Originally Posted by Fishy27
lol, is there a way to un curve it?


Originally Posted by danzig-_-
I don't know....I guess use the other hand.
Last edited by Wolfdarrigan at May 7, 2008,
#4
do{
SomeCodeHere
}while ( TRUE )
I think
Quote by clapton-floyd
I don't believe in free will, I believe in Rohypnol.