Thread: Case error, desperatly need help!!!

  1. #1

    Case error, desperatly need help!!!


    I have a question which is an error that bothers me and I canīt figure it out. I am doing menus, and using switch, so on the third case thereīs an error which says

    'case bypasses initialization of a local variable'

    could someone please explain what this means, another thing when I erase that case the program runs perfectly. Just for you to know, that case only has cout<<"text" lines, not any actual function etc. please could you help me out?

  2. #2
    Registered User
    Join Date
    Sep 2001
    You have declared variables inside the cases. Either move them outside the switch-statement or surround each case with '{}'.
    // Gliptic

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Segmentation fault!?!?!?
    By Viper187 in forum Windows Programming
    Replies: 57
    Last Post: 10-02-2008, 09:40 PM
  2. Format Precision & Scale
    By mattnewtoc in forum C Programming
    Replies: 1
    Last Post: 09-16-2008, 10:34 AM
  3. Base converter libary
    By cdonlan in forum C++ Programming
    Replies: 22
    Last Post: 05-15-2005, 01:11 AM
  4. Creating pop up menus
    By Ti22 in forum C++ Programming
    Replies: 22
    Last Post: 01-18-2005, 09:27 PM
  5. Binary Search Trees Part III
    By Prelude in forum A Brief History of
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM