I have seen that unsigned int ranges from 0 to 4,294,967,295. I cannot print this to the user without a warning though. I'm just trying to understand the limits of variables, so this is just for my reference.
Here is the code:
Code:
#include <stdio.h>
int main(){
unsigned int a = 4294967295;
// 4 Bytes [Signed: -2147483648 to 2137483647, Unsigned: 0 to 4294967295]
printf("%u", a);
return 0;
}
Basically, I want the warning to go away. I read about using limit.h, but that is not what I'm trying to do. I just want to know the maximum value that data types will hold.
Warning I get:
Code:
warning: this decimal constant is unsigned only in ISO C90 [enabled by default]
Thanks for your time.