943,829 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 3583
  • C++ RSS
Feb 26th, 2004
0

Cannot get switch to execute

Expand Post »
I am doing a program in C++ with do while loops and switch case. After the user enters the info required, the program automatically does the while part. It is not ejecuting the switch case (most important part in my program). What can I do?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Marcela is offline Offline
2 posts
since Feb 2004
Feb 26th, 2004
0

Re: help please!!

Can you show us your code so that we can see if there are any errors?
A switch statement should be in the following form:

C++ Syntax (Toggle Plain Text)
  1. switch (variable)
  2. {
  3. case expression1: { statement1; break; }
  4. case expression2: { statement2; break; }
  5. ...
  6. default: { defaultstatement; }
  7. }
Last edited by cscgal; Feb 26th, 2004 at 1:43 pm.
Administrator
Staff Writer
Reputation Points: 1422
Solved Threads: 162
The Queen of DaniWeb
cscgal is offline Offline
13,645 posts
since Feb 2002

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Creating and destroying objects
Next Thread in C++ Forum Timeline: while loop in c++ help needed





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC