C Language Grammar

Source: Internet
Author: User

1, the function pointer type definition, then the pointer struct type definition, the final call form is aaa.bbb (); (AAA is a struct variable) or
AAA->BBB (); (AAA is a struct pointer), function pointers are best packaged in a struct to become pointer structures, encapsulating multiple types.
function pointer to synthesize a struct.
2. Encapsulation of common macro functions
3. Use of event-bit macro definitions
4, the structure definition, the member is the structure body, constructs the more complex data structure.
5. Use extern to declare external variables and external functions in the header file.
6. Use the precompiled macro switch to control whether the header file is included or not and whether the statement is compiled or not.
7, the use of bit segments can save RAM space.
8. The enumeration variable is incremented by default from 0, or it can be assigned to a different value from one of the beginning, followed by a re-increment.
9. Put some macro definitions, data structure type definition, external variable declaration, external function declaration in the header file.
10, the source file in the macro definition, data structure type definition, static variables, static function declaration, function implementation.
11, the essence of the function is 3 big program structure--order structure, cycle structure, select structure, these kinds of structure mix constitute the procedure.
12. Array of string pointer constants
13, external variables in the header file with an extern representation declaration (declaration, cannot be initialized), in the source file defined variables (defined, can be initialized
Uninitialized).
14, the Declaration of the header file, the function before the extern expression declaration, the variable before the addition of extern representation declaration.
15. When defining and initializing a struct, assign a value to the struct member and add a point to the member name to indicate the assignment. As shown below:
{
. PINSDA = BOARD_SDA,
. PINSCL = BOARD_SCL
}

C Language Grammar

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.