Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - What is integer overflow in C language? What are bit operators and shift operators?
What is integer overflow in C language? What are bit operators and shift operators?
Just answer the above question about overflow and add some. Different machines occupy different bit widths. Not all 32.

In addition, regarding overflow:

If my space is only 4-bit binary now (the same is true regardless of the following complement and symbols)

That is, I can only represent data from 0000 to111(that is, 0- 15).

If I have saved such a data as111now, but the system wants to give it+1, then this time it will become1+1= >/. When 16 should be displayed, it becomes 0. At this time, we said that it had overflowed. The same is true for 32 bits, that is, 32 bits 1. Then+1 will be 0.

Bit operators are operators that operate on each bit in binary data, which are called bit operators. . . . For example ~ ~)

First of all, the data111b (that is, 15, what is b? Let us know ...) If and 10 10B (that is, 10) and operation (and or not? . . & amp& amp|| ! Then the result should be a Bool with a value of true (not 0 is true, two are true ...).

If111b and 10 10B are used for bitwise and operation (&; ) Then the result should be 10 10 instead of 1. This is a bit operation. ..

Shift operator

It's just moving ... >> and