Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - How to convert unsigned integer and signed integer (a topic), forget the expert's advice, thank you.
How to convert unsigned integer and signed integer (a topic), forget the expert's advice, thank you.
int a;

Unsigned b;

a =- 10; The binary code of /*a is (111111165438.

b = a; The binary code of /*b is (111111165438.

printf("%d,%u/n ",a,b);

b = 6552 1; The binary code of /*b is (1111111/.

a = b; The binary code of /*a is (11111111/.

printf("%d,%u/n ",a,b);

Just look at the binary storage part of the number.

Negative numbers store the complement, and positive numbers store the original code.