views:

143

answers:

1

How do I do to handles some big positive integers (like 9,999,999,999) on Visual C++ 2008 on a 32-bit PC.
Please give an example on declaring, printf, scanf of these big positive integers.
Please consider using 9,999,999,999 in your example.

+3  A: 
unsigned long long foo;
scanf("%llu", &foo);
printf("%llu", foo);
Andreas Brinck
That should be `%lld`, since you have declared it as signed rather than unsigned.
caf
Thanks, changed foo's definition to unsigned, since the question stated that the numbers were positive
Andreas Brinck
Thanks you guys!
yihang