Error: #77-D: This declaration has no storage class or type specifier

Source: Internet
Author: User

When using Keil to write programs, inadvertently found a particularly simple and easy to ignore the problem, compile the following error:

Error: #77-D: This declaration has no storage class or type specifier

According to the error point, found that the corresponding program line is very simple, (the real program is to define the structure, and then the structure of the assignment), where the equivalent simplification, the program is as follows:

//////////////

int A;

A = 1;

/////////////

Then found the beginning of the article error, after debugging to know: "The assignment of variables generally can not be placed outside the function , only in the definition of global variables when the initialization is allowed." ”

	So if you have to define variables outside of a function, either do not assign a value definition (defined within a function), or immediately define it after the declaration, for this example, you can modify the following:
	int a=1,    so there is no error.


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.