What is wrong with my switch statement? It seems like that's how I've done it other times. But I get a warning that says, "switch contains no 'case' or 'default' labels and I get an error that says, "illegal case". What the hell? Note: I had more code in case 1 but I cut it to see if it was something within that particular code but I still got nothing...

#include <iostream>
using namespace std;

int main()
{
	
	int choice;
	int option;
	int id;
	int type;
	float salary;	
	float rate;
	float hours;
	float increase;
	float totalGrossPay = 0;
	float totalFedTax = 0;
	float totalStateTax = 0;
	float totalSS_Withholding = 0;
	float totalWithholding = 0;
	float totalNetPay = 0;

	do
	{
		//This is the main menu.
		cout << "   Main Payroll Menu\n\n";
		cout << "1. Add Employee\n";
		cout << "2. Update Employee\n";
		cout << "3. Apply Pay Increase\n";
		cout << "4. Output Payroll\n";
		cout << "5. Exit the Program\n\n";
		cout << "Please choose one.\n\n";
		cin >> choice;
		cout << "\n";

			switch (choice);
			{
				case 1: cout << "LOL";
				break;
			}

	} while (choice != 5);
return 0;
}
switch (choice);

No semi-colon here. Now kick yourself. I've been there.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.