C Programming language Note (13) Reference manual 5

Source: Internet
Author: User
Tags goto

Statement
If not specifically stated, the statements are executed sequentially
9.1 Labeled Statements
Tagged statement identifier: statement case constant expression: statement The default: statement is a label consisting of identifiers declaring that the only purpose of the identifier identifier designator is that the jump target label as a goto statement itself does not alter the program's control flow

  

9.2 Expression Statements
Most expression statements are called by an assignment statement or function

  

9.3 Compliant Statements
Objects of type static are initialized only once before the program begins execution

  

9.4 SELECT statement
if (expression)  statement if (expression) statement Else Statement-switch (expression) statement

  

9.5 Loop Statements
while (expression) statement do statement while (expression); for (expression 1; expression 2; expression 3) statement

  

9.6 Jump Statements
goto identifier; Continue;break;return expression;

  

10 external declarations
The processing input unit provided to the C compiler is called a translation unit

  

function definition
function definition declaration specifier declarator Declaration table Compound Statement declaration specifier can only use storage class specifier extern or static function can return arithmetic type struct union pointer or void type value, but cannot return function or array type

  

External declarations
Externally declared properties that specify object functions and other identifiers outside of the function that indicate that they are outside the functions, and that objects that are not directly declared outside the keyword extern connection can specify no storage class, or can be specified as extern or static if an object or function declaration contains a static specifier, The identifier only has an internal connection

  

11 Scopes and connections
All the cells of a program do not have to be compiled at the same time. The source files can be kept in several files, each of which can contain multiple translation units, and pre-compiled routines can be loaded from the library. Inter-Program function communication can be achieved by invoking and manipulating external data. We need to consider two types of scopes the first is the lexical scope of the identifier, which is the text area of the program that embodies the identifier attribute the second is the scope associated with objects and functions with external connections, which determine the connection between identifiers in individual compiled compilation units

  

Lexical scopes
Identifiers can be used in several namespaces without affecting each other. If you are in a different namespace, even within the same scope, the same identifier may be used for different destination namespaces including object function type definition name enumeration constant label result tag Union tag enum TAG structure and union member in declaration external object, The lexical scope of an object or function identifier starts at the end of its declaration, and the scope of the formal parameter in the function definition begins at the beginning of the function program block, at the end of the translation unit. and runs through the entire function. Scope of the formal parameter in the function declaration ends at the end of the declarator the scope of the identifier declared in the header of the block is the scope of the entire program block designator it is located in.

  

Connection
In a translation unit, all declarations of the same object or function identifier with an internal connection apply to the same entity and all claims that the object or function is unique to the translation unit that have an external connection with the same object or function identifier also refer to the same entity. and the object or function is shared by the entire program if the static specifier is used, the first outer declaration of the identifier will make the identifier internally connected

  

C Programming language Note (13) Reference manual 5

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.