Parse error in ubantu/Linux system [How to Solve]

Parse error in ubantu/Linux system

This problem took me some time. In order to avoid forgetting to post a blog in the future


The execution code and error reporting contents are as follows:


This is because the standard supported by the Linux gcc compiler is different from the current C89 standard. This C standard requires that the declaration of variables in a block be placed in front of all non declarative statements.

We can see that on line 266, a definition statement is placed before the declaration statement, so an error is reported


Put 266 this non declarative statement under all declarative statements
as shown in the following figure:

the compilation succeeded without error, and the problem was solved successfully

Read More: