Variable
In the C language, variables must be defined and used before they must be initialized.
int i; i = 10;
Under C99 rules, variables can be initialized directly after they are defined.
int ten;
When a global variable is not initialized, the default initial value is 0.
data types and input and output
Integer data is decorated with unsigned, which indicates that the variable is an unsigned integer, which is a positive integer.
Input and output:
unsigned:u%
Octal: o%
Hex: X
The i% can automatically identify the input data in order to output.
Char is essentially an integral type. The lowercase letter and the uppercase itself differ by 32.
Char ' a ' ; Char ' A ' ;p rintf ("%d\n", A-B);
The run result is 32.
The case conversion of a character can be achieved by adding or minus 32.
Enum: enum
Union: Union
struct: Structure
structStudent {Charname[Ten]; intAge ; }; //Accessing structure interior elements structStudent S = {"xiaoming", -}; intAge =S.age; //accessing structure interior elements with struct pointers structStudent *p; P= &s; intA = p->age;
typedef: Alias a type
// Mystudent represents the struct student. struct student mystudent; = {"xiaoming",+};
Const: Modified object immutable, nearest principle
extern: External declarations
C Study Notes