Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How to assign values to character variables with plastic data
How to assign values to character variables with plastic data
(1) For example, int is 2 bytes and char is 1 byte;

For example, if the 16-base int type represents 2345H, the lower 8 bits of plastic data are 45H.

(2) Obtain the code representation of the lower 8 bits of the int type.

# include & ltstdio.h & gt

void main()

{

int a = 0x 1234;

char m;

m =(char)a; //or m = ((char *)&; a)[0];

printf("%x\n ",m);

System ("suspended");

}

Supplement: The binary representation of 289 is: 00000010010001.

So the lower eight bits are 00 1000 1, which is 33.