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

This is a discussion on Exception Handling, How? Try/Catch throw... within the C++ Programming forums, part of the General Programming Boards category; You should hang out with this guy ... Code: void GetInput() { Controller controlInput; Menu menu; bool inputIsInvalid; char input[80]; ...

  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

Page 2 of 2 FirstFirst 12
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, 06:33 AM
  2. exception handling
    By coletek in forum C++ Programming
    Replies: 2
    Last Post: 01-12-2009, 04:28 PM
  3. Signal and exception handling
    By nts in forum C++ Programming
    Replies: 23
    Last Post: 11-15-2007, 01: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

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