Cannot get switch to execute

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Feb 2004
Posts: 2
Reputation: Marcela is an unknown quantity at this point 
Solved Threads: 0
Marcela Marcela is offline Offline
Newbie Poster

Cannot get switch to execute

 
0
  #1
Feb 26th, 2004
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?
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 12,054
Reputation: cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light 
Solved Threads: 129
Administrator
Staff Writer
cscgal's Avatar
cscgal cscgal is offline Offline
The Queen of DaniWeb

Re: help please!!

 
0
  #2
Feb 26th, 2004
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:

  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.
Dani the Computer Science Gal
Follow my Twitter feed! twitter.com/DaniWeb
And if you're interested in Internet marketing there is twitter.com/DaniWebAds
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC