I think I'm getting confused by the use of Hexadecimal values...I do not understand what bitmasking is with this example? I can't see whats happening as a result of the code to demonstrate this feature. Can someone explain what Bitmasking is and how this following code represents that? is it ( going from the right of hexadecimal ) values comparing 0 & 1, then 0 & 1, then F & 1 (is F & 1 = the "1" in 0x0100, which is the result that prints out)? ect....?
Code:
short mask = 0xFF00, value, masked;
value = 0x0111;
masked = mask & value;
printf("bitmask: %#x \n\n", masked);