Bitwise-AND
You can also bitwise-AND two bytes together to create a third. In this case, a bit on the third byte is 1 only if the corresponding bits in the first two bytes are both 1.
Figure 38.4 Two bytes bitwise-ANDed together
This is done with the & operator. Add the following lines to main.c:
#include <stdio.h> int main (int argc, const char * argv[]) { unsigned char a = 0x3c; unsigned char b = 0xa9; unsigned char c = a | b; printf("Hex: %x | %x ...
Get Objective-C Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.