Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Assuming that all variables are integers, the value of the expression (a=2, b=5, b++, a+b) is
Assuming that all variables are integers, the value of the expression (a=2, b=5, b++, a+b) is

Use commas in c to indicate each operation. The above formula refers to the value of b after the operation is completed, which is of course 2+6.

In C language, multiple expressions can be separated by commas. The values ??of expressions separated by commas are settled separately, but the value of the entire expression is the value of the last expression.

Integer values ??can be specified in decimal, hexadecimal or octal notation, preceded by an optional sign (- or +). If using octal notation, the number must be preceded by 0 (zero), and if using hexadecimal notation, the number must be preceded by 0x.

Extended information:

The basic type specifier is int. Depending on the internal word length of the computer and the compiler version, it may occupy 2 or 4 bytes in the memory (usually On 16-bit machines and 32-bit machines respectively), its value is a basic integer constant.

The short integer type specifier is short int or short, which occupies 2 bytes in memory, and its value is a short integer constant. The long integer type specifier is long int or long, which occupies 4 bytes in memory, and its value is a long integer constant.

4.64-bit integer (non-ANSI standard) type specifier is __int64, long long int or long long, which occupies 8 bytes in memory, and its value is a 64-bit integer constant.