do..while loop question - help newbie please

Discussion in 'Software' started by bobjohnson, Jul 4, 2004.

  1. bobjohnson

    bobjohnson Private E-2

    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.
     
  2. NeoNemesis

    NeoNemesis Moutharrhea

    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? :)
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds