PDA

View Full Version : do..while loop question - help newbie please


bobjohnson
07-04-04, 14:48
I am a complete newcomer when it comes to programming and I have a project that I am working that I hope someone can help me with.

I have created a "simple" program that has a menu and the user can select a letter to accomplish some task. I have 'X' as the letter to exit the program and I want to make sure that it will exit if they select 'X' or 'x'. I am using a do..while loop. I am doing this for a class in C++ that I am taking and must use this loop to accomplish the task.

When I use:
} while ( option != static_cast< int > ( 'X' ) );

It will correctly exit like I want when the user selects X. But if I use and us the or || somehow to get it to work with X or x I can't make it work. How to I code the while part so that if either X or x is chosen it will exit?

I am using Visual C++ 6.0.

Thanks for any help and sorry if I didn't ask the question correctly... this is all new to me.

NeoNemesis
07-05-04, 19:26
could you please send me some information on how i can make it so if the user presses a key or number it will bring them to a different function? :)