Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - It is known that the length i = 65539 executes the printf statement ("%d", i); Screen display 3 Why? Thank you for your answers.
It is known that the length i = 65539 executes the printf statement ("%d", i); Screen display 3 Why? Thank you for your answers.
You defined the long plastic I, but the output is in plastic format;

That is, printf("%d ",i); The format control character %d in means I shape the output;

The variable defined by long is 4 bytes, that is, 32 bits; The variable defined by int is 2 bytes, that is, 16 bits (on tc compiler).

65539 occupies 32 bits in memory, namely 000000000001000000001.

If it is to be output in plastic form, it needs to intercept 16 bits from the lower order and convert it into decimal output, that is, 0000000000 1 1. You always know what its decimal number is!

Have you just learned C language? Hehe, we were depressed when we first learned, but it's no problem. As long as you slowly ponder the knowledge in the textbook, you can certainly learn it well, and you will find it very interesting!

Come on! ! !