0
int Seats::AddEntry()
{
	std::cout << "Please enter your desired seat position";
	std::cout << endl;
	std::cin >> position;

	ofstream SaveFile("Traveler.txt",ios::in);
		
	SaveFile << "Your Seat postion is...:";
	SaveFile << endl;
	SaveFile >> position;
	SaveFile.close();
	
	return 0;
}

This is just a snippit of my code...This function is one of 3 member functions that when I compile an error statement comes up for all 3 that:

'Seats::ViewEntry' : local function definitions are illegal
and....
this line contains a '{' which has not yet been matched

Please can you help me find the error...I figured if all three had the same error then maybe fixing one would help me to fix the others

2
Contributors
1
Reply
5
Views
8 Years
Discussion Span
Last Post by Ancient Dragon
0

The problem is in some code before those functions. Most likely you forgot the function's closing brace }. That makes the compiler think that the next function is being nested inside the previous function. Count the braces and make sure there is a } for every {.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.