// combining two unsigned shorts into an unsigned int. short ush = 4; short usl = 9999; int ucombined = ( ush & 0xffff ) << 16 | ( usl & 0xffff );