中的int64_t定义 [英] Definition of int64_t
问题描述
我是新来的C / C ++,所以我有一对夫妇约一个基本类型的问题:
a)您能向我解释的int64_t 和长
(长之间的
的区别INT
)?
在我的理解,都是64位整数。是否有任何理由要选择一个比其他?
二)我试图查找中的int64_t
在网络上的定义,但没有成功。有权威人士透露我需要这样的问题需要咨询?
c)对于code。使用的int64_t
来编译,我目前包括< iostream的>
,这没有多大意义,我。是否还有其他包括提供的声明的int64_t
?
a)您能向我解释的int64_t 和
长
(长之间的
的区别INT
)?在我的理解,都是64位整数。是否有任何理由要选择一个比其他?
块引用>前者是一个符号整型用的究竟的64位。后者是一个符号整型用的至少的32位。
二)我试图查找
中的int64_t
在网络上的定义,但没有成功。有权威人士透露我需要这样的问题需要咨询?
块引用>HTTP://cp$p$pference.com 这里涵盖这样的:<一href=\"http://en.cp$p$pference.com/w/cpp/types/integer\">http://en.cp$p$pference.com/w/cpp/types/integer.该权威人士透露,然而,这是<一个href=\"http://stackoverflow.com/questions/81656/where-do-i-find-the-current-c-or-c-standard-documents\">C++标准(此特定位可在§18.4整数类型中找到[cstdint])。
c)对于code。使用
的int64_t
来编译,我包括&LT; iostream的&GT;
,其中没有多大意义了我。是否还有其他包括提供的声明的int64_t
?
块引用>这是
&LT宣布; cstdint&GT;
或&LT; cinttypes&GT;
(下命名空间STD
)或&LT; stdint.h&GT;
或&LT; inttypes.h&GT;
(全局命名空间)。I am new to C/C++, so I have a couple of questions about a basic type:
a) Can you explain to me the difference between
int64_t
andlong
(long int
)? In my understanding, both are 64 bit integers. Is there any reason to choose one over the other?b) I tried to look up the definition of
int64_t
on the web, without much success. Is there an authoritative source I need to consult for such questions?c) For code using
int64_t
to compile, I am currently including<iostream>
, which doesn't make much sense to me. Are there other includes that provide a declaration ofint64_t
?解决方案a) Can you explain to me the difference between
int64_t
andlong
(long int
)? In my understanding, both are 64 bit integers. Is there any reason to choose one over the other?The former is a signed integer type with exactly 64 bits. The latter is a signed integer type with at least 32 bits.
b) I tried to look up the definition of
int64_t
on the web, without much success. Is there an authoritative source I need to consult for such questions?http://cppreference.com covers this here: http://en.cppreference.com/w/cpp/types/integer. The authoritative source, however, is the C++ standard (this particular bit can be found in §18.4 Integer types [cstdint]).
c) For code using
int64_t
to compile, I am including<iostream>
, which doesn't make much sense to me. Are there other includes that provide a declaration ofint64_t
?It is declared in
<cstdint>
or<cinttypes>
(under namespacestd
), or in<stdint.h>
or<inttypes.h>
(in the global namespace).这篇关于中的int64_t定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!