954,180 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Cannot get switch to execute

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?

Marcela
Newbie Poster
2 posts since Feb 2004
Reputation Points: 10
Solved Threads: 0
 

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:

switch (variable)
{
	 case expression1: { statement1; break; }
	 case expression2: { statement2; break; }
	 ...
	 default: { defaultstatement; }
}
cscgal
The Queen of DaniWeb
Administrator
19,421 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 229
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You