Quote:
|
Originally Posted by zhan
swith(choice)
|
You spelled 'switch' wrong, that would make a compiler error. Also, you don't appear to have any braces around your switch statement. You could rewrite it like:
Code:
switch(choice)
{
case 1:
//do stuff
break;
case 2:
//do other stuff
break;
case 3:
return 0; //Quit from within the case statement
break;
default:
//if the user inputted something that wasn't a legal command
}
I don't know what the print() function is for, it seems like it just outputs the arguments the user entered, twice. And it will also print some garbage because you never declare the char 'op' to be equal to anything.