Run-Time Error variable not defined?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • yogi_bear_79

    Run-Time Error variable not defined?

    I shorted the following code for the purpose of this post. I get a
    run-time error that
    value is not defined. I don't understand what I have done wrong.
    Through varios testing methods I've noticed it will throw the error on
    both variables subChoice and value. Thanks for yuor time.



    void mainMenu(int choice)
    {
    int subChoice, value;

    switch ( choice )
    {
    case 1:
    ............
    cout << "\n\n Please select a choice from the menu: ";
    cin >subChoice;
    cout << "\n\n Please enter a number to convert: ";
    cin >value;
    break;
    case 2:
    ..........
    }

    subMenu(subChoi ce, value);
    }
Working...