0. The program simulates the motion of the real world. Process-oriented programming considers that each program must complete some defined functions. Each program is implemented through a series of data processing processes. Therefore, the program design includes organizing data-designing data structures and processing the data structures-designing algorithms.
1. the XOR operator "^" can be used to flip a value. If you want to flip a bit of a variable, it is just to change the volume and the number where the remaining number at the position 1 is set to 0 for an exclusive or operation.
2. The left shift operator "<". The left shift is equivalent to 2. For unsigned Int or char data, the right shift operator adds 0 to the left end when the right shift is performed. For signed int and char data, if the sign bit is 0, the left side is supplemented with 0, if the value is 1, the left side is filled with 1, which is equivalent to Division 2.
3. the return value of the scanf function refers to the number of items that have been successfully matched, that is, the number of items that have been correctly entered by the parameters in the comparison format.
4. A bitwise segment is a member in a special structure. It defines the length of a member in the structure in units of bits. It allows users to easily access the relevant bits in one byte, which is more important in control. Example of a declaration:
Struct packed_data
{
Unsigned int A: 3;
Unsigned INT: 4; // The unsigned segment is used to start the next segment from another byte
Unsigned int C: 5;
Unsigned int D: 4;
} X;
Reference Method: X. A, X. C, X. D; Value assignment allowed: X. A = 2;
5. Data of the character type (such as 'A', '3') is stored in the memory with the corresponding ASCII code. Trusted data and certificates are common in the ASCII code range of characters.
6. The C language provides an operator "sizeof" to determine the length of a certain type of data storage space ".
7. according to the C language, all numeric sequences starting with numbers 0 in the program are processed as Octal numbers; All numbers followed by digits starting with 0x are processed as hexadecimal numbers; other numbers are processed as decimal numbers. An integer is followed by an L or L as a long integer.
8. constants can only be expressed in decimal format.
9. escape characters: \ n newline, \ t; \ v; \ B; \ r; \ f; \ backslash;
\ 'Single quotes character \ DDD 1 to 3 octal characters; \ xhh 1 to 2 hexadecimal characters.
10. The number of characters in the string becomes the length of the string. When storing the string, it must take up one more byte to store "\ 0 ".
11. modulo operator in C language: "%"
12. When a real number (floating point number) is converted to an integer, the fractional part of the real number is all removed and stored as an integer. However, please note that the integer part of the value cannot exceed the maximum range allowed by the integer (-32768 ~ 32767). Otherwise, an error occurs. When the double type is converted to the float type, the redundant valid numbers are removed, but rounded down.
13. When a long integer is converted to a short integer, only the remainder of the original data value in the form of 32768 is obtained.
14. when the getchar function is executed, although it is to read a character, it is not read from the keyboard by a character, it is read to a character variable, but after entering a row and pressing the Enter key, then, the gechar function returns a character from the buffer to a character variable.