I'm working on a program in C++ that is supposed to output som data from a couple of classes. I thought I'd let the user choose what to output (what function) through a switch in main. This is basicly how the main looks now. (Just a general overview of the class)
int main(void)
{
char input;
cout << "Whole lotta stuff about how to choose function" << endl;
do
{
switch(input)
{
case '1':
ClassName1.methodDefinedInThisClass1;
break;
case '2':
ClassName1.methodDefinedInThisClass2;
break;
case '3':
ClassName2.methodDefinedInThisClass1;
break;
case '4':
ClassName2.methodDefinedInThisClass2;
break;
default:
"Illegal option!";
break;
} // end switch
} // end do
while(input != '5');
system("PAUSE");
return 0;
} // end main
From this I get this error:
error C2143: syntax error : missing ';' before '.'
I'm not totally blond so I understand I'm missing a ';'. But I can't find it! I've looked through the classes, the switch, everything and I can't find it!
So my thought is that something is wrong with the switch. I haven't used this in c++ before, only Java. So there's a good possibility that I've done this wrong. Anyone got a tip?