#include <iostream>
#include <cstdlib>
#include <ctime>
#include <string>
int pause;
int main()
{
int numbvar;
std::cout << "Enter a number to push into the Cases: ";
std::cin >> numbvar;
switch (numbvar);
{
case 0:
std::cout << "Testing case 0";
break;
default:
std::cout << "Your number was not 0!";
}
std::cout << "\n\n The program has ended, press any key to continue.\n";
std::cin >> pause;
return 1;
}
ID:186599
Jun 4 2005, 8:24 am
|
|
I need help with cases this time, they looked so easy! I only looked at them for 2 minuets and I learned the structure but I seem to be having problems. I tried doing them for myself, but I gave up because I kept getting errors. When I looked at the book I realized I made a few small mistakes that I would'nt make again. After I copied exactly what the book had down, I still got errors! Here is the source. The errors I get are, the cases aren't in a switch statement.
|
Jun 4 2005, 8:31 am
|
|
Try removing the semi-colon after the switch().
|
In response to InuTracy
|
|
InuTracy wrote:
That was a stupid mistake. Thank you, I didn't see it. <.< ">DaniWeb C/C++ forums</font> - Go there when you're looking for C++ help. Prodigal Squirrel |