Noob question about an error
| Reiyn (12) | |||||
| Hello, I am writing an app to take in user name and bday, then return zodiac and birthstone..I am attempting to separate it into functions, am using switch, andgetting a "missing ; before switch" error, I can't see it, noone else in class can see where one is missing either. Help! Here is the error statement: Compiling... UserBday.cpp C:\Documents and Settings\Kevin Schuth\Desktop\KSchuth Final\Final\UserBday.cpp(8) : error C2143: syntax error : missing ';' before 'switch' C:\Documents and Settings\Kevin Schuth\Desktop\KSchuth Final\Final\UserBday.cpp(9) : error C2447: missing function header (old-style formal list?) Zodiac.cpp C:\Documents and Settings\Kevin Schuth\Desktop\KSchuth Final\Final\Zodiac.cpp(8) : error C2143: syntax error : missing ';' before 'switch' C:\Documents and Settings\Kevin Schuth\Desktop\KSchuth Final\Final\Zodiac.cpp(9) : error C2447: missing function header (old-style formal list?) Error executing cl.exe. Final.exe - 4 error(s), 0 warning(s) and the code main is here:
One of the functions code:
Both the Bday and the Zodiac cpp get this same error... Thanks | |||||
| jsmith (379) | |||
Remove the ; on the switch line.
| |||
| Faldrax (282) | |||
And also remove the ; on the end of
void UserBday (int m, int d, int y);I'm assuming here that the switch statemen is the implementation of UserBday. | |||
| Reiyn (12) | |||
| I implemented both your suggestions, and each resulted in two more errors, lol. The errorx are the same for both the BDAy and Zodiac cpp's...I am so lost! | |||
| Reiyn (12) | |||
| XD I figured it out, I needed a second set of brackets to include switch in the function, removed the ; you both suggested, and it runs fine Thanks guys! ..now to get the date to figure out the correct zodiac sign lol, it's going by month right now, which is just unacceptable hehe | |||
This topic is archived - New replies not allowed.
