Expected initializer before `int` Int main

Expected initializer before `int’ Int main. This wasn’t happening before and I cannot see why this error is happening. There is nothing before int main as all functions are declare and defined in different files. I have been trying everything I can think of.


Try running all of the codes in a test environment, like on cpp.sh (C++ Shell online test site). Or post all of the code for us to test it ourselves, I can imagine the error might not necessarily originate from ufo.cpp - but I never touched C++ myself, just putting this common procedure here for starters.


I see nothing wrong with what you have in the code editor. Could you show us the other two files (ufo_functions.cpp & ufo_functions.hpp)?

1 Like

The other two code files: image (the code after this was in the file by default) and image

1 Like

Look closely at your end_game() function in your ufo_functions.hpp file. If you don’t see it, click the spoiler below:

Missing ; at the end of your end_game(std::string answer, std::string codeword) function declaration.

1 Like

Thanks! Didn’t see that there. I was confused by the wording of the error.

1 Like