C中数据类型的大小? [英] Size of data types in C?

查看:79
本文介绍了C中数据类型的大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁决定C中数据类型的大小?

它是:

1.C标准,因此编译器

2。操作系统。

Who decides size of data types in C?
Is it the:
1.C standard and hence the compilers
2.Operating System.

推荐答案

文章< 11 ***************** ****@g44g2000cwa.googlegroups。 com>,

siliconwafer< sp ********* @ yahoo.com>写道:
In article <11*********************@g44g2000cwa.googlegroups. com>,
siliconwafer <sp*********@yahoo.com> wrote:
谁决定C中数据类型的大小?
它是:
1.C标准,因此编译器
2.Operating系统。
Who decides size of data types in C?
Is it the:
1.C standard and hence the compilers
2.Operating System.




两者,或者更确切地说是全部三种。


标准对几种类型的最小尺寸设置约束。 br />
编译器可以使用它满足这些约束的任何大小,

但是为了与操作系统的库互操作和

满足用户的期望任何成功的编译器都必须考虑操作系统。


没有什么能阻止你为Linux编写提供17的C编译器-bit

整数和18位指针,但你不会卖很多。


- Richard



Both, or rather all three.

The standard places constraints on the minimum size of several types.
The compiler can use any sizes it likes that meet these constraints,
but in order to interoperate with the operating system''s libraries and
meet the expectations of users any successful compiler will have to
take the operating system into account.

Nothing stops you writing a C compiler for Linux that provides 17-bit
ints and 18 bit pointers, but you won''t sell many.

-- Richard


硬件怎么样......难道不是它依赖于那个......?


因为如果H / W能够那么只...实施很有用......?


r ight ..?

what about the Hardware...Doesn''t it maily rely on that...?

coz if the H/w is capable then only...the implementation is useful...?

right..?



7t * ******@gmail.com 写道:
硬件怎么样......难道不是很依赖它......?

对..?
what about the Hardware...Doesn''t it maily rely on that...?

coz if the H/w is capable then only...the implementation is useful...?

right..?



哪个H / W *完全*决定这个?是编译器存储变量的内存的数据宽度是什么?b $ b或者它是CPU regesters?


Which H/W *exactly* decides this?Is it the data width of memory where
the compiler stores the variables? OR is it the CPU regesters?


这篇关于C中数据类型的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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