Why am i getting 0 ?? And compiler warning:
format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘long unsigned int’
Assuming an int
is 4 bytes and you have 8 bit bytes, then int
is 32 bits wide. Subsequently a signed int
(if negatives are represented in 2's complement) has a range of -2147483648 to 2147483647 while unsigned int
has a range of 0 to 4294967295.
The value 4294967296 in binary is 1 00000000 00000000 00000000 00000000
. This is 33 bits. So 4294967296 is too big for this type.