Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - In C language, how to divide a plastic into two bytes? Please enlighten me.
In C language, how to divide a plastic into two bytes? Please enlighten me.
Word2Byte (unsigned short integer n)

{

Printf("%u: low byte =0x%02X, high byte =0x%02X. \n ",n,n & gt& gt8,n & amp255);

}

Or:

Word2Byte (unsigned short integer n)

{

Unsigned bytes num_l, num _ h;;

num _ l = n & amp255;

num _ h = n & gt& gt8;

Printf("%u: low byte =0x%02X, high byte =0x%02X. \n ",n,num_h,num _ h);

}