size_t是单词大小吗? [英] Is size_t the word size?
问题描述
size_t
是编译代码的计算机的字长吗?
Is size_t
the word size of the machine that compiled the code?
使用g ++进行解析时,我的编译器将size_t
视为long unsigned int
.编译器是在内部选择size_t
的大小,还是在调用编译器之前在stddef.h
的某些预处理器宏中将size_t
实际键入字大小?
Parsing with g++, my compiler views size_t
as an long unsigned int
. Does the compiler internally choose the size of size_t
, or is size_t
actually typdefed inside some pre-processor macro in stddef.h
to the word size before the compiler gets invoked?
还是我偏离了轨道?
推荐答案
在C ++标准中,[support.types](18.2)/6:类型size_t
是实现定义的无符号整数类型,该类型很大足以包含任何对象的字节大小."
In the C++ standard, [support.types] (18.2) /6: "The type size_t
is an implementation-defined unsigned integer type that is large enough to contain the size in bytes of any object."
这可能与字长"相同,无论这是什么意思.
This may or may not be the same as a "word size", whatever that means.
这篇关于size_t是单词大小吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!