im getting a weird error in my program. my compiler is telling me :
expected `}' at end of input
expected unqualified-id at end of input
expected `,' or `;' at end of input
and its highlighting the last line of my code, which is the closing bracket for my main() function. i have commented out all of the code in int main(), but it still refuses to compile. i checked for missing ";" and theres nothing. SciTE checks parentheses and brackets and stuff, so i know everything is closed properly. i dont seem to be doing anything crazy at all
would including classes cause these errors?
#include <iostream>
#include <fstream>
#include <vector>
#include "commands.h"
int main(){
}
if a problem were in commands.h, would it manifest at the last bracket?
You probably forgot the semicolon after the closing brace on a class or structure definition.
class C
{
} // <<-- HERE, semicolon needed
One of the other things that can appear there is a variable declaration:
class C
{
} c; // <<-- creates a global variable of type "class C"
Since a variable name is an unqualified-id, this explains your error message.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With