i have code which has a menu..

this code is for a tic tac toe game and i cant prevent the program from crashing .

when the user enters a variable e.g 'q' the program crashes. the happens whilst playing the game and whilst selecting a menu option. is there any way to prevent this???

Any help would be greatly appreciated.....

may we see your code, or would that be cheating?

is there any way to prevent this???

Yes there is, probably.

the better question is, why it crashes? What is the real reason?

my apologies lads..... i havent been on in a while. but the problem is not just with my current projects.

But all projects i complete with user input. e.g
cout<<"please enter a menu option"<<endl;

if i declare this variable as an int... then any char makes the error lines run to infinity until system memory runs out...

Is there a variable type i could use to prevent this.. it may be real simple. thanks in advance

If your options are numbers (less than 10), why not make it a char variable? If you needed the int value you could just subtract '0' from it.

char a = '1';
int b = (int)(a-'0');

thats a great idea thanks for the quick response....