error: expected unqualified-id error: Meaning and fix? [duplicate]

As stated by @user657267 get rid of the semicolons when declaring a function and its implementation. If you were to have

int some_function(int a, int b);

above the main and the implementation of that function below the main

int some_function(int a, int b) {
    //something happens here
     return a;
}

That would be ok. The implementation can also go above the main and then you don’t have to write the first line defining the function. The reason the definition or implementation has to be above the main is c, or c++ for that matter, won’t be able to see the function otherwise which will throw and error as well.

Leave a Comment