Question: C PROGRAM PLEASE: Using the right-shift operator, the bitwise AND operator and a mask, write function unpackCharacters that takes the unsigned integer from Exercise 10.13

C PROGRAM PLEASE:

Using the right-shift operator, the bitwise AND operator and a mask, write function unpackCharacters that takes the unsigned integer from Exercise 10.13 and unpacks it into two characters. to unpack two characters from an unsigned integer, combine the unsigned integer with the mask 65280 (00000000 00000000 11111111 00000000) and right shift the result 8 bits. Assign the resulting value to a char variable. Then combine the unsigned integer with the mask 255 (000000000000000000000000 11111111). Assign the result to another char variable. The program should print the unsigned integer in bits before it is unpacked, then print the characters in bits to confirm that they were unpacked correctly.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!