2. Format:
%d is an integer, %c is a character,%% is an output, and%% LD is an output long integer.
%f is output floating-point type (decimal form) and %e is output floating-point type (exponential form).
%lf/%le is used to output double type, %g selects shorter %e/%f type and does not output extra zeros.
%o output octal, not negative, %x output hexadecimal.
%hd is used to output short integers. ?
%s of string
Priority of c language operators:
1, priority:
In C language, the operation priority of operators is divided into 15 levels. 1 the highest, 15 the lowest. In an expression, a higher priority operates before a lower priority. When the operators on both sides of an operand have the same priority, they are treated according to the combination direction specified by the operator combination.
2. Binding:
There are two kinds of associative laws for operators in C language, namely, left associative law (from left to right) and right associative law (from right to left). For example, the combination of arithmetic operators is from left to right, that is, first left and then right. If there is an expression x-y+z, then Y should be combined with the "-"sign to perform x-y operation, and then perform +z operation. This combination direction from left to right is called "left combination". The combination direction from right to left is called "right combination". The most typical right association operator is the assignment operator. For example, x=y=z, because of the right combination of "=", y=z should be performed before the operation of x=(y=z). Many operators in C language are right-related, so we should pay attention to their differences to avoid misunderstanding.
The priority decreases from top to bottom, with the top having the highest priority and the comma operator having the lowest priority.
Of all the priorities, only three are combined from right to left. They are monocular operators, conditional operators and assignment operators. Everything else is combined from left to right.
Those with the highest priority are not real operators, they are a special operation. () is related to functions, [] is related to arrays, and->; And ... It is a structural member.
Secondly, monocular operators, all of which have the same priority, have the highest priority among real operators in my opinion, and because they are all combined from right to left, there is no doubt that *p++ is equivalent to *(p++).
3, formula notes:
Priority formula
Keywords round square brackets, arrow sign, self-increasing and self-decreasing, nonnegative, strong address length,
Multiplication, division, addition and subtraction, relocation,
Small and equal, and so on,
Eight sums, seven differences, six, five sums, four sums, three doubts, two fu, one is really funny.
Where ""is a hierarchical segment.