在GNU / Linux中表示64位整数 [英] Representing a 64 bit integer in GNU/Linux
本文介绍了在GNU / Linux中表示64位整数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用Ubuntu 10.10(64位)与 gcc
,我想在我的C ++程序中使用64位整数。
I am using Ubuntu 10.10 (64 bit) with gcc
and I wanted to use a 64 bit integer in my C++ program.
在我的系统上输出 sizeof(long)
, )
和 sizeof(int64_t)
都是8字节(64位)。
On my system the outputs of sizeof(long)
, sizeof(long long int)
and sizeof(int64_t)
are all 8 bytes (64 bits).
哪个限定符( long
, long long
int64_t
)你会建议使用64位整数吗?
Which qualifier (long
, long long
, or int64_t
) would you recommend for using 64 bit integers?
推荐答案
int64_t
- 这是因为它是最便携的表示。其他两个可以在其他机器上表示不同。
int64_t
-- This is because it is the most portable representation. The other two could be represented differently on other machines.
这篇关于在GNU / Linux中表示64位整数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文