1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

UNIX系でのバイトオーダー(エンディアン)の調べ方

Posted at

バイトオーダーとは

2bytes以上のデータをメモリに格納する際の順番のこと。
割り当てられているメモリの後ろの方から格納していくのをリトルエンディアン、反対に頭の方から格納していくのをビッグエンディアンという。
どちらが採用されているかはCPUによって異なる(Intel系はリトルエンディアン)。

調べ方

> sysctl hw.byteorder

出力結果が'1234'ならリトルエンディアン、'4321'ならビッグエンディアン。

参考

https://atmarkit.itmedia.co.jp/icd/root/70/5784470.html
http://piyocast.com/as/archives/10591

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?