Case error, desperatly need help!!!

This is a discussion on Case error, desperatly need help!!! within the C++ Programming forums, part of the General Programming Boards category; Hi, I have a question which is an error that bothers me and I canīt figure it out. I am ...

  1. #1
    Unregistered
    Guest

    Case error, desperatly need help!!!

    Hi,

    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
    Posts
    164
    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, 08:27 PM
  5. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM

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