<dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><small id="yhprb"></small><dfn id="yhprb"></dfn><small id="yhprb"><delect id="yhprb"></delect></small><small id="yhprb"></small><small id="yhprb"></small> <delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"></dfn><dfn id="yhprb"></dfn><s id="yhprb"><noframes id="yhprb"><small id="yhprb"><dfn id="yhprb"></dfn></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><small id="yhprb"></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn> <small id="yhprb"></small><delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn>
"); //-->

博客專(zhuān)欄

EEPW首頁(yè) > 博客 > printf如何輸出64位整數

printf如何輸出64位整數

發(fā)布人:電子禪石 時(shí)間:2020-09-03 來(lái)源:工程師 發(fā)布文章

關(guān)于printf函數輸出64位數的問(wèn)題,其實(shí)在window下和linux下是不一樣的:

 

 linux下是

printf("%lld/n",a);

printf("%llu/n",a);

 

windows下是

printf("%I64d/n",a);

printf("%I64u/n",a);

 

完整程序如下:

[zcm@c #51]$cat a.c  
// linux平臺C程序  
  
#include <stdio.h>  
  
typedef unsigned long long int64;  
typedef unsigned long long uint64;  
  
int main ( void )  
{  
    int64    c = 0x123456789LL;        // 有符號  
    uint64    uc = 0x123456789ULL;    // 無(wú)符號  
  
    printf("%lld, %llu\n", c, uc);    // 整數形式輸出  
    printf("%llx, %llx\n", c, uc);    // 十六進(jìn)制格式輸出  
    printf("%#llx, %#llx\n", c, uc);// 帶0x的十六進(jìn)制格式輸出  
  
    return 0;  
}  
[zcm@c #53]$make  
gcc -g -O2 -o a a.c  
[zcm@c #54]$./a  
4886718345, 4886718345  
123456789, 123456789  
0x123456789, 0x123456789  
[zcm@c #55]$


[zcm@c #51]$cat a.c
// linux平臺C程序

#include <stdio.h>

typedef unsigned long long int64;
typedef unsigned long long uint64;

int main ( void )
{
    int64    c = 0x123456789LL;        // 有符號
    uint64    uc = 0x123456789ULL;    // 無(wú)符號

    printf("%lld, %llu\n", c, uc);    // 整數形式輸出
    printf("%llx, %llx\n", c, uc);    // 十六進(jìn)制格式輸出
    printf("%#llx, %#llx\n", c, uc);// 帶0x的十六進(jìn)制格式輸出

    return 0;
}
[zcm@c #53]$make
gcc -g -O2 -o a a.c
[zcm@c #54]$./a
4886718345, 4886718345
123456789, 123456789
0x123456789, 0x123456789
[zcm@c #55]$
jpg改rar


*博客內容為網(wǎng)友個(gè)人發(fā)布,僅代表博主個(gè)人觀(guān)點(diǎn),如有侵權請聯(lián)系工作人員刪除。



關(guān)鍵詞:

相關(guān)推薦

技術(shù)專(zhuān)區

關(guān)閉
国产精品自在自线亚洲|国产精品无圣光一区二区|国产日产欧洲无码视频|久久久一本精品99久久K精品66|欧美人与动牲交片免费播放
<dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><small id="yhprb"></small><dfn id="yhprb"></dfn><small id="yhprb"><delect id="yhprb"></delect></small><small id="yhprb"></small><small id="yhprb"></small> <delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"></dfn><dfn id="yhprb"></dfn><s id="yhprb"><noframes id="yhprb"><small id="yhprb"><dfn id="yhprb"></dfn></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><small id="yhprb"></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn> <small id="yhprb"></small><delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn>