[Linux] Little Endian, Big Endian ํ์ธ
๋ด ์ปดํจํฐ๊ฐ Little endian์ธ ์ง, Big endian์ธ ์ง ํ์ธํด๋ณด์!
์ ์ฒด ์ฝ๋
๊ฐ๋ณ๊ฒ ์๋ ์์ค๋ฅผ ์ปดํ์ผ&๋น๋ ํ ์คํํด๋ณด์ !
#include <iostream>
using namespace std;
int main(int argc, char** argv)
{
int i = 0x00000001;
if ( ((char *)&i)[0] )
cout << "Little" << endl;
else
cout << "big" << endl;
return 0;
}
Leave a comment