What is the best way to construct a bit mask in C with m set bits preceded by k unset bits, and followed by n unset bits:
m
k
n
~(~0 << m) << n