C, C++

How to output long long or int64?

Binceline 2014. 3. 3. 05:06
I just want to output a long long or int64 variable use printf
function.But if I use printf("%ld",x); I can't output an x more than
long.
I can only output it like this:
long long a,b,c;
a=c/100000000;
printf("%ld",a);
b=c%100000000;
printf("%08ld\n",b);
How can I output it in an regular way?

Nov 15 '05 #1
Share this Question
  Share on Google+ 
26 Replies


Zara
P: n/a
On 10 Nov 2005 23:12:17 -0800, "Betaver@gmail.com" <Betaver@gmail.com>
wrote:
I just want to output a long long or int64 variable use printf
function.But if I use printf("%ld",x); I can't output an x more than
long.
I can only output it like this:
long long a,b,c;
a=c/100000000;
printf("%ld",a);
b=c%100000000;
printf("%08ld\n",b);
How can I output it in an regular way?


long->printf("%ld"...
long long->printf("%lld"...

Intuitive.

Best regards,

-- Zara


반응형