Syntax errors will be the death of me!
- From: Jes <theeternalkid@xxxxxxxxx>
- To: programmingblind@xxxxxxxxxxxxx
- Date: Sat, 10 Jul 2010 22:20:33 -0400
Hey guys,
Here's a code for an assignment which has to be turned in tomorrow. Every time
I try to compile it, Visual Studio keeps telling me I'm missing a ; before <<
What's wrong?
Code follows:
//Ch6ConE06.cpp
//Displays a class rank based on a code
//entered by the user
//Created/revised by <your name> on <current date>
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
int main()
{
//declare variable
int code = 0;
//enter input
cout << "Enter the code: ";
cin >> code;
//enter switch statements
switch(code)
{
case 1:;
cout << "Freshman. " ; << endl;
break;
case 2:
cout <<"Sophomore"; << endl;
break;
case 3:
cout << "Junior "; << endl;
break;
case 4:
cout << "Senior" ; << endl;
break;
case 5:
cout << "Error! "; << endl;
}
//endswitch
//display output
return 0;
} //end of main function
Jes
- Follow-Ups:
- RE: Syntax errors will be the death of me!
- From: Ken Perry
- Re: Syntax errors will be the death of me!
- From: Jacob Kruger
- Re: Syntax errors will be the death of me!
- From: Alex Hall
- RE: Syntax errors will be the death of me!
- From: Joseph Lee
- Re: Syntax errors will be the death of me!
- From: RicksPlace
- RE: Syntax errors will be the death of me!
Other related posts:
- » Syntax errors will be the death of me! - Jes
- » RE: Syntax errors will be the death of me! - Ken Perry
- » Re: Syntax errors will be the death of me! - Jacob Kruger
- » Re: Syntax errors will be the death of me! - Alex Hall
- » RE: Syntax errors will be the death of me! - Joseph Lee
- » RE: Syntax errors will be the death of me! - Joseph Lee
- » RE: Syntax errors will be the death of me! - Joseph Lee
- » Re: Syntax errors will be the death of me! - Alex Hall
- » RE: Syntax errors will be the death of me! - Ken Perry
- » Re: Syntax errors will be the death of me! - RicksPlace
- » Re: Syntax errors will be the death of me! - RicksPlace