binary is:111111165438" />
Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - long a = oxffffint b = a; printf("%d ",b); Please explain why the output result is-1.
long a = oxffffint b = a; printf("%d ",b); Please explain why the output result is-1.
# contains "stdio.h"

Master ()

{

long a = 0xffff

int b = a;

printf("%d ",b);

}

The output result is-1 because:

A is a long integer of 4 bytes.

0xffff hexadecimal-> binary is:111111165438.

b = a; B is 0xffff hexadecimal-> binary is:111111165438.

1 1 1 1 1 1 1 1 1 1 1 1 165438.