size_t是单词大小吗? [英] Is size_t the word size?

查看:124
本文介绍了size_t是单词大小吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆