Lecture 24 Objectives


At the end of today's class you should

KNOW:

BE ABLE TO:

Sample Exam Question:

Write a function called Pack that satisfies the following pre- and post-conditions:

PRE:  char1 and char2 are characters
POST: the function returns an unsigned short (i.e. 16-bit unsigned integer) with char1 packed into the
      high-order 8 bits and char2 packed into the low-order 8 bits
You should use the shift and OR bit operations to accomplish the packing.