liitle endian [英] liitle endian

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

问题描述

是否可以通过编写C程序来了解系统是小端还是大端

?如果有的话,有人可以给我一个想法吗?

方法...


非常感谢。


问候,

Raghu

Is it possible to know whether a system is little endian or big endian
by writing a C program? If so, can anyone please give me the idea to
approach...

Thanks a ton.

Regards,
Raghu

推荐答案

raghu说:
raghu said:

是否可以通过编写C程序来了解系统是小端还是大端


Is it possible to know whether a system is little endian or big endian
by writing a C program?



如果你小心,它可能无关紧要。


-

Richard Heathfield

Usenet是一个奇怪的地方 - dmr 29/7/1999
http://www.cpax.org.uk

电子邮件:rjh在上述域名中, - www。

If you''re careful, it''s possible for it not to matter.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.


2006年12月9日星期六09:59:44 + 0000,Richard Heathfield

< rj*@see.sig.invalidwrote:
On Sat, 09 Dec 2006 09:59:44 +0000, Richard Heathfield
<rj*@see.sig.invalidwrote:

> raghu说:
>raghu said:

>是否可以通过编写C程序来了解系统是小端还是大端?
>Is it possible to know whether a system is little endian or big endian
by writing a C program?



是的。

Yes.


>如果你小心,那就是''它可能没关系。
>If you''re careful, it''s possible for it not to matter.



是的。甚至有些人甚至可以运用诗意的许可证,并将你的回答改为:b / b
如果你真的很小心,它可以保证没关系。


-

jay


Yes. And some might even exercise poetic license and rephrase your
answer to something like this:

If you''re really carefull, it''s guaranteed for it not to matter.

--
jay



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

raghu< ra ********* @ gmail.comwrote:
In article <11**********************@f1g2000cwa.googlegroups. com>,
raghu <ra*********@gmail.comwrote:

>是否有可能通过编写C程序来了解系统是小端还是大端?如果是这样,任何人都可以给我一个想法来接近...
>Is it possible to know whether a system is little endian or big endian
by writing a C program? If so, can anyone please give me the idea to
approach...



字节序的本质是当你使用
访问两种不同大小的对象的地址。当您获取较小的对象时,你会获得更大的

对象的大端还是小端?


In C,你可以合法地将任何对象视为一个字节序列,所以你可以确定b
$ b可以确定端点(尽管它不能保证

要么大 - 或者小端 - 它可能是一些陌生的东西。)


- 理查德


-

应考虑在一些字母表中需要多达32个字符

- 1963年的X3.4。

The essence of endianness is the question of what happens when you use
an address to access objects of two different sizes. When you fetch
the smaller object, do you get the big end or the little end of larger
object?

In C, you can legally treat any object as a sequence of bytes, so you
can indeed portably determine the endianness (though it''s not guaranteed
to be either big- or little-endian - it could be something stranger).

-- Richard

--
"Consideration shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.


这篇关于liitle endian的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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