C ++中的int64和int64_t有什么区别? [英] What is the difference between int64 and int64_t in C++?
问题描述
我是c ++和编码的新手。所以这个问题可能是愚蠢的。使用int64或int64_t类型有什么区别。我看到其中一个软件开发人员在github上修改了他们的源代码,并将所有的int64修改为int64_t。
I am new to c++ and coding in general. so this question might be noobish. what is the difference in using type int64 or int64_t. I saw that one of the software devs modified their source on github and all of the int64 to int64_t.
推荐答案
int64_t
是标准C ++类型,用于完全64位的有符号整数。 int64
不是标准类型。
int64_t
is a Standard C++ type for a signed integer of exactly 64 bits. int64
is not a standard type.
第一个C ++标准没有固定宽度类型。在将 int64_t
添加到标准C ++之前,不同的编译器都实现了64位类型,但它们使用了自己的名称(例如 long long
, __ int64
等。)
The first C++ standard didn't have fixed-width types. Before int64_t
was added to Standard C++, the different compilers all implemented a 64-bit type but they used their own names for it (e.g. long long
, __int64
, etc.)
一系列可能的事件是这个项目最初的对于支持的每个编译器,将 typedef int64
改为64位类型。但是,一旦编译器开始更好地支持标准C ++,或者编写代码的人发现 int64_t
,代码就会被切换为使用标准名称。
A likely series of events is that this project originally would typedef int64
to the 64-bit type for each compiler it was supported on. But once compilers all started to support Standard C++ better, or once the person who wrote the code found out about int64_t
, the code was switched over to use the standard name.
这篇关于C ++中的int64和int64_t有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!