Stuck again!

This is a discussion on Stuck again! within the C++ Programming forums, part of the General Programming Boards category; oops...I hit enter too soon. I tried typing in a letter for the menu and it kept repeating its self ...

  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.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 6
    Last Post: 10-23-2006, 08:22 PM
  2. string array stuck:(
    By mass in forum C Programming
    Replies: 18
    Last Post: 05-22-2006, 05: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, 08:37 PM
  5. stuck ky
    By JaWiB in forum Tech Board
    Replies: 2
    Last Post: 06-15-2003, 09:28 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21