C Primer Plus note5, primerplusnote5
Error: expected '=', ';', 'asm 'or' _ attribute _ 'before' {'token |
In this case, don't look at the three errors shown here. Let's calm down and find a mistake one by one.
First, there is an error in row 5th. The error is that a punctuation mark is missing before '{'. What is the punctuation mark.
Well, it should be noted that when the compiler lacks a punctuation mark in the code
The row number under the line of code in. Because the compiler does not know that a punctuation mark is missing in the code at the beginning
When compiling the following code, it is found that the end of the line of code that originally lacks punctuation marks should be ';' semicolon, and the result is compiled by the compiler.
Is a '{' Right braces, so the compiler will report an error in the line being compiled, and remind you that a punctuation mark may be missing before.
Based on this principle, we can find out whether there are missing punctuation marks in the code above 5th lines.
Unfortunately, it is also because of the fast speed that a semicolon is missing in the function declaration at the end of the second line of code.
Let's make corrections:
Now, don't look at the errors reported by the compiler on the 24 and 32 lines. Let's compile the compiler first:
Here, I would like to tell you: do not be confused when encountering many errors. What is impossible may happen now. When people make mistakes, please calm down and solve them one by one.
It is likely that a mistake has led to many errors and is found out slowly.