You're printing the value with %d, which is limited to signed int. The C99 specifier for unsigned long long is %llu:
#include <stdio.h>
int main(void)
{
unsigned long long int cnt;
for (cnt = 0; cnt <= 4026531840; cnt++)
printf("%llu\n", cnt);
}
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401