Expected identifier or '('

We get this compilation error, but I can’t understand why. The error message has been commented out.

float remainingAngle(float angleA, float angleB); { // Expected identifier or '(' return 180 - (angleA + angleB); } int main (int argc, const char * argv[]) { float angleA = 30.0; float angleB = 60.0; float angleC = remainingAngle(angleA, angleB); printf("The third angle is %.2f", angleC); return 0; } 
+4
source share
2 answers

You have a semicolon at the end of the first line.

+15
source

Remove the semicolon between the function declaration and the opening bracket

+3
source

Source: https://habr.com/ru/post/1380851/


All Articles