请设计一个小程序来判断当前是大端字节序还是小端字节序?

	int a = 0x00000001;
	char* p = (char*)&a;
	if (*p == 1)
	{
		cout << "小端" << endl;
	}
	else
	{
		cout << "大端" << endl;
	}

你可能感兴趣的:(c++,算法,前端)