Hello.
I've been doing a small application that will go (using only unsigned integer values) from 0 to 4026531840 and print them out.
My code is next:
#include <stdio.h>
#include <inttypes.h>
int main(void){
uint64_t cnt;
for(cnt=0;cnt<=4026531840;cnt++){
printf("%d\n",cnt);
}
}
The only problem that i have is the last numbers are negative (the really last one is -268435456).
I also tried using:
#include <stdio.h>
int main(void){
unsigned long long int cnt;
for(cnt=0;cnt<=4026531840;cnt++){
printf("%d\n",cnt);
}
}
but the problem persists.
I'm using gcc:
Target: x86_64-linux-gnu
gcc version 4.6.1 (Debian 4.6.1-4)
on my linux machine:
Linux mysql 3.0.0-1-amd64 #1 SMP Sat Aug 27 16:21:11 UTC 2011 x86_64 GNU/Linux
Any ideas?