What is it that makes value in a variable of type _Bool have the value 1, even when we assign a value greater than 1 to it?
For example:
#include <stdio.h> int main(void) { _Bool tmp = 10; printf("%x, %lu\n", tmp, sizeof(tmp)); return 0; } This would print 1, 1. I am trying to understand what makes a variable of size byte act as a single bit and when assigned a value greater than 1 which has its LSB 0 still get converted to 1.
size_t(the result of thesizeofoperator) is%zu. Mismatching format specifier and argument type leads to undefined behavior.