#include #include #include int main(){ unsigned long x = 1; for(int i = 0; i < 34; i++){ printf("%8lx %ld\n", x, x); x = x << 1; } x = 28; // Is there a 1 in the 8's place? printf("x >> 3 = %d\n", (x >> 3) << 3); // x &= 0xFFFFFFFFFFFFFFF7; // turn off the 8's place x &= ~8; printf("x = %lu\n", x);/* x |= 8; // turn on the 8's place x |= 8; // turn on the 8's place x |= 8; // turn on the 8's place x |= 8; // turn on the 8's place */ printf("x = %lu\n", x); if((x << 60 ) >> 63){ printf("8's place is 1\n"); } if(x & 8){ printf("8's place is 1\n"); } uint8_t c = 0x7F; printf("%x\n", c); c = ~c; printf("%x\n", c); unsigned long *pointer = &x; bool use_pointer = true; if(pointer && use_pointer){ printf("pointer is valid and we should use it!\n"); } return 0; }