C Primer Plus note5, primerplusnote5

Source: Internet
Author: User

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.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.