#include指示和头文件
Example: #include <stdio.h>
- Function: Equivalent to the full content of the file stdio.h that you typed in the file, where the line is located
- #include语句是: C preprocessor directive (Purpose: C compiler to prepare the source code before compiling, so called preprocessing)
- . h= header files (different header files typically contain a number of different function functions, and the header file contains the information required by the compiler to build the final executable program)
Main () function
- A program has and only one, and can only have a main () function
Variable declaration
- All variables in C must be declared before use, defined
Benefits: Easy to read, easy to understand, avoid errors, do not declare variables will not compile your C!!!
Data type
- Data type: integer int float float character char, specifying variable as specified data type
Selection of variable names
- The naming of names has meaning
- The naming of names requires the following rules: lowercase letters, uppercase letters, numbers, underscores! (Remember: The first character must be a letter or a glide line)
Assign value
Assignment operator: "="
A simple program structure:
- preprocessing directives
- Function name with parameters
- Statement statement
- Assignment statements
- Function statements
C Language--Overview