Was trying this switch code online, but it fails for me, saying "unresolved externals". What is missing? my Visual Express doesn't actually show me any errors.
//switch case
#include <iostream>
using namespace std;
int main()
{
int a;
cout << "What time of day is it? \n";
cout << "1) Morning \n";
cout << "2) Afternoon \n";
cout << "3) Evening \n";
cout << "Enter a choice: \n";
cin >> a;
switch (a)
{
case 1:
cout << "Good Morning!";
break;
case 2:
cout << "Good Afternoon!";
break;
case 3:
cout << "Good Evening!";
break;
default:
cout << "Not a valid entry....";
break;
}
}