Thread: Exception Handling, How? Try/Catch throw...

  1. #16
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    You should hang out with this guy...
    Code:
    void GetInput()
    {
        Controller controlInput;
        Menu menu;
        bool inputIsInvalid;
        char input[80];
        int length;
        int i;
    
        do
        { 
            inputIsInvalid = true;
    				
            while(inputIsInvalid)
            {
                menu.MainMenu();
     
                cout << endl << "Enter Option: " ;
                cin >> input;
                length = strlen(input);
                if(length > 1)
                {
                    cout << "input is invalid" << endl;
                }
                else if(!isdigit(input[0]))
                {
                    cout << "input is invalid" << endl;
                }
                else
                {
                    i = atoi(input);
                    inputIsInvalid = false;
                }
    
                cout << endl << endl ;
                controlInput.CommandControl(i);
            }
            while (i != 3);
        }
    
        void main()
        { //error C2062 is pointing to this line
            Menu::Info();
            GetInput();	
        }
    Notice anything odd?


    Quzah.
    Hope is the first step on the road to disappointment.

  2. #17
    Registered User
    Join Date
    Jun 2005
    Posts
    131
    errrr

    bows head in shame

    Case closed.....

    Thanks

    for the help

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Exception handling in a large project
    By EVOEx in forum C++ Programming
    Replies: 7
    Last Post: 01-25-2009, 07:33 AM
  2. exception handling
    By coletek in forum C++ Programming
    Replies: 2
    Last Post: 01-12-2009, 05:28 PM
  3. Signal and exception handling
    By nts in forum C++ Programming
    Replies: 23
    Last Post: 11-15-2007, 02:36 PM
  4. Exception handling framework based on multiple inheritance
    By Mario F. in forum C++ Programming
    Replies: 11
    Last Post: 06-25-2007, 10:17 AM
  5. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM