Thread: Stuck again!

  1. #16
    Registered User
    Join Date
    Oct 2003
    Posts
    15
    oops...I hit enter too soon. I tried typing in a letter for the menu and it kept repeating its self over and over lol.

  2. #17
    Spaced Cadet
    Join Date
    Aug 2003
    Posts
    110
    Code:
      default: 	 {
            cout<<"Error, bad input, quitting";
            return 0;
      } //Question, why do you have a two space indent, then change to a 4 space indent?

  3. #18
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    yes, if the user is susposed to enter an int but enters a char or some value that can't be interpretted as an int, then the program is likely to enter an endless loop. To figure out how to handle that problem you need to use data validation techniques. It's not hard, but it's not as easy as you might think either. There are a number of ways to do it. Starting with a search of the board is a good place to start. Then determine which technique you wish to use. Give it a try. Come back when you get stuck.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 6
    Last Post: 10-23-2006, 07:22 PM
  2. string array stuck:(
    By mass in forum C Programming
    Replies: 18
    Last Post: 05-22-2006, 04:44 PM
  3. Program stuck in infinite loop-->PLEASE HELP
    By Jedijacob in forum C Programming
    Replies: 5
    Last Post: 03-26-2005, 12:40 PM
  4. Stuck on random generating
    By Vegtro in forum C++ Programming
    Replies: 3
    Last Post: 10-01-2003, 07:37 PM
  5. stuck ky
    By JaWiB in forum Tech Board
    Replies: 2
    Last Post: 06-15-2003, 08:28 PM