sizeof运算符的依赖关系 [英] dependency of sizeof operator

查看:51
本文介绍了sizeof运算符的依赖关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

sizeof(int)的输出会有所不同。但是它依赖于什么。可以请任何人

帮助我找出它是依赖于编译器还是操作系统

依赖?

Output of sizeof(int) varies.But on what it depends.Can anybody please
help me to find out if it is compiler dependent or operating system
dependent?

推荐答案

这取决于您使用的机器和编译器。例如,如果你使用turboC / C ++来获得sizeof(int)你获得2但是在相同的

机器上如果你使用gcc或MS Visual studio sizeof(int)= 4。

It depends on the machine you are using and the compiler also. e.g if
you use turboC/C++ to get sizeof (int) you get 2 but on the same
machine if you use gcc or MS Visual studio sizeof(int)=4 .


" vandana" < va ************* @ gmail.comwrites:
"vandana" <va*************@gmail.comwrites:

sizeof(int)的输出会有所不同。但是它依赖于什么任何人都可以请

帮我查一下它是依赖于编译器还是操作系统

依赖?
Output of sizeof(int) varies.But on what it depends.Can anybody please
help me to find out if it is compiler dependent or operating system
dependent?



这取决于C的实现;粗略地说,在

编译器上。但是C实现经常受到操作系统和CPU架构的强烈影响



-

Comp-sci博士预计在结束之前2007年

寻求2008年加州*以外的工业或学术职位

It depends on the C implementation; roughly speaking, on the
compiler. But the C implementation is often strongly influenced
by the operating system and the CPU architecture.
--
Comp-sci PhD expected before end of 2007
Seeking industrial or academic position *outside California* in 2008


" vandana" < va ************* @ gmail.comwrote in message
"vandana" <va*************@gmail.comwrote in message

sizeof(int)的输出各不相同。但是它的含义是多少取决于任何人请

帮我查一下它是依赖于编译器还是操作系统

依赖?
Output of sizeof(int) varies.But on what it depends.Can anybody please
help me to find out if it is compiler dependent or operating system
dependent?



int应与寄存器的大小相同。然而,一些邪恶的人已经在64位计算机上实现了32位整数。所以这取决于编译器

作家。


-

免费游戏和编程好东西。
< a rel =nofollowhref =http://www.personal.leeds.ac.uk/~bgy1mmtarget =_ blank> http://www.personal.leeds.ac.uk/~bgy1mm

int should be the same size as a register. However some wicked people have
implemented 32 bit ints on 64-bit machines. So it is up to the compiler
writer.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm


这篇关于sizeof运算符的依赖关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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