C Compile Link

Source: Internet
Author: User

First, main is the execution of the entrance, into main can be executed, outside of main is a number of global variables or function definition.


The C function treats each file as a module, since each file is a block (this is like the Paython), then the module has to have a private property method and the property method provided externally, in the C language, if the variables and methods in a file are modified by extern, Then this indicates that this variable is a reference to the external module of the variable, popularly said that this variable is at least two modules between the general variables, if static to decorate then this variable is the module itself and other modules are not universal. Once a connector has found a variable A that is not static modified in a module, it is labeled in the export symbol table, and then in the other module encounters a that is not modified by the static, then this a is considered to be a variable that exists in the export table. So repeating the definition of a single assignment in a different module is supposed to be allowed, but the duplicate assignment is not good because the compiler cannot determine which value is the exact value. Compile, each module as a separate individual exists, so the address may have started from 0x0000, it is clear that we need to set an offset for each module, to ensure that the variables in the different modules are not address coverage, of course, extern external variables are not affected by the offset address of this module , which module he comes from will be affected by the offset address of that module. To be blunt is the current address + offset address to get a new address. For the origin of the. h, guess ha, suppose we write a file A.C inside defines a lot of variables, and then we need to use these variables in the B.C, to know that the C rules must be defined before use Ah, although a, b we will eventually join together, according to the truth in a statement within the line, but no, C language provisions must precede the Ming, if using other modules of the externxx, of course, this extern can be omitted, so ah we finally extract the statement, pay attention to the rationale for this. h should not be assigned, which is the norm. The concrete principle will be mended in succession, and now some tired.

C Compile Link

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.