I tried that but still get errors,
#include <iostream>
using namespace std;
std::string aLine;
int main()
{
system("title Simple use of the switch statement.");
system("Color C");
unsigned int digit;
cout << "Please enter a digit between 1 & 5 : ";
cin >> digit;
switch(digit)
{
case '1':
cout << endl << "You selected 1!";
break;
case '2':
cout << endl << "You selected 2!";
break;
case '3':
cout << endl << "You selected 3!";
break;
case '4':
cout << endl << "You selected 4!";
break;
case '5':
cout << endl << "You selected 5!";
break;
}
cin.getline( aLine );
return 0;
}
Or have i used the code incorrectly?