Why am i getting 0 ?? And compiler warning:
format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘long unsigned int’
If your int
or unsigned int
is 32-bits, neither can store the value 4294967296
since this is 2**32
which would require a 64-bit type.
Even uint32_t
can only store the max value 2**32 - 1
so your value is just 1
out of range.
But int32_t
can store the max positive value 2**31 - 1
so the signed type is even further off.