如何输出long long或int64? [英] How to output long long or int64?
问题描述
我只想输出一个long long或int64变量使用printf
function.But如果我使用printf("%ld",x);我不能输出超过
的x。
我只能这样输出:
long long a,b, c;
a = c / 100000000;
printf("%ld",a);
b = c%100000000;
printf("%08ld \ n",b);
如何以常规方式输出?
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?
推荐答案
2005年11月10日23:12:17 -0800,Be ***** @ gmail.com < Be ***** @ gmail.com>
写道:
On 10 Nov 2005 23:12:17 -0800, "Be*****@gmail.com" <Be*****@gmail.com>
wrote:
我只想输出一个long long或int64变量使用printf
function.But如果我使用printf("%ld",x);我不能输出超过
的长度。
我只能这样输出:
long long a,b,c;
a = c / 100000000;
printf("%ld",a);
b = c%100000000;
printf("%08ld \ n",b) ;
如何以常规方式输出?
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" ...
直观。
祝你好运,
- Zara
long->printf("%ld"...
long long->printf("%lld"...
Intuitive.
Best regards,
-- Zara
2005-11-11,是***** @ gmail.com < Be ***** @ gmail.com>写道:
On 2005-11-11, Be*****@gmail.com <Be*****@gmail.com> wrote:
我只想输出一个long long或int64变量使用printf
function.But如果我使用printf("%ld",x);我输出的x不能超过
我只能这样输出:
多长a,b,c;
a = c / 100000000;
printf("%ld&q uot;,a);
b = c%100000000;
printf("%08ld \ n",b);
如何以常规方式输出方式?
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?
" int64"是非标准的,可能采用非标准格式
说明符。
%lld很长时间。
"int64" is non-standard, and probably takes a non-standard format
specifier.
%lld for long long.
Zara:
我写道:
#include< stdio.h>
long long a;
int main()
{
a = 999999999;
a * = 5;
pfrintf (%lld,a);
}
但输出705032699,为什么?
Zara:
I wrote:
#include <stdio.h>
long long a;
int main()
{
a=999999999;
a*=5;
pfrintf("%lld",a);
}
But it outputs 705032699, why?
这篇关于如何输出long long或int64?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!