的sizeof(INT) [英] sizeof(int)
问题描述
是否有某种规范列表,或者有人愿意给出
简要说明,以便:
sizeof(int)
sizeof(long int)
sizeof(long long)
等>
或甚至是矢量类型,用于当前编译器使用的当前硬件(Pentium
4 / Athlon / G4 / G5 / Playstation 3 /等)?或者
或许你可以定义什么大小的int_t列表并期望
处理器本地处理?
" Richard Cavell" < RI *********** @ mail.com>写了...是否有某种规范列表,或者有人想给出一个简短的概述,如:
sizeof(int)
sizeof(long int)
sizeof(long long)
etc
sizeof(int)是以字节为单位表示的int对象的大小。 br />
sizeof(long int)是long int对象的大小。
sizeof(long long)是一个语法错误,因为C ++没有long long。类型。
我不确定规范列表是什么你正在谈论。
或甚至是矢量类型,用于当前编译器使用的当前硬件(Pentium
4 / Athlon / G4 / G5 / Playstation 3 /等)?或者也许
你可以定义什么大小的int_t列表并期望处理器本地处理?
如果你需要特定于编译器的东西,请在新闻组中询问
致力于该编译器。这里讨论的C ++与编译器无关。
如果您需要特定于硬件的东西,请在新闻组中询问
专用于该硬件。 C ++是一种与硬件无关的语言。
V
27/2/05 3:03 AM,Victor Bazarov写道:
C ++是一种与硬件无关的语言。
不,它不是。
我必须以不同的方式编写我的程序,具体取决于这些sizeofs
是多少。所以它根本不是硬件独立的。
" Richard Cavell" < RI *********** @ mail.com>写了...在27/2/05 3:03 AM,Victor Bazarov写道:
C ++是一种与硬件无关的语言。
不,它不是。
我必须根据这些尺寸的不同来编写我的程序。所以它根本不是硬件独立的。
这不是语言,愚蠢。这是你的算法,它是你想要的,你需要做什么,这使得它依赖于硬件。
Hi,
Is there some kind of canonical list, or would someone like to give a
brief rundown, as to:
sizeof(int)
sizeof(long int)
sizeof(long long)
etc
or perhaps even the vector types, for current hardware (Pentium
4/Athlon/G4/G5/Playstation 3/etc) used with current compilers? Or
perhaps a list of what size int_t you can define and expect the
processor to handle natively?
"Richard Cavell" <ri***********@mail.com> wrote...Is there some kind of canonical list, or would someone like to give a
brief rundown, as to:
sizeof(int)
sizeof(long int)
sizeof(long long)
etc
sizeof(int) is the size of an int object expressed in bytes.
sizeof(long int) is the size of a long int object.
sizeof(long long) is a syntax error since C++ has no "long long" type.
I am not sure what "canonical list" you''re talking about.
or perhaps even the vector types, for current hardware (Pentium
4/Athlon/G4/G5/Playstation 3/etc) used with current compilers? Or perhaps
a list of what size int_t you can define and expect the processor to
handle natively?
If you need something compiler-specific, please ask in a newsgroup
dedicated to that compiler. C++ discussed here is compiler-independent.
If you need something hardware-specific, please ask in a newsgroup
dedicated to that hardware. C++ is a hardware-independent language.
V
On 27/2/05 3:03 AM, Victor Bazarov wrote:
C++ is a hardware-independent language.
No, it ain''t.
I have to write my program differently depending on what these sizeofs
are. So it''s not hardware-independent at all.
"Richard Cavell" <ri***********@mail.com> wrote...On 27/2/05 3:03 AM, Victor Bazarov wrote:C++ is a hardware-independent language.
No, it ain''t.
I have to write my program differently depending on what these sizeofs
are. So it''s not hardware-independent at all.
It''s not the language, silly. It''s your algorithm, it''s what you want
to do, that makes it hardware-dependent.
这篇关于的sizeof(INT)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!