how to print memory bits in c
You would need to assign a pointer to the variable in question to a char *, and treat it as an array of bytes of length sizeof(variable). Then you can print each byte in hex using the %X format specifier to printf. You can define a function like this: void print_bytes(void *ptr, int size) { … Read more