【c++11关键字】 reinterpret_cast
2020-10-28 本文已影响0人
小鱼号的代码日记
/*
* c++11关键字
* reinterpret_cast
* 小鱼号的代码日志
*/
#include <QCoreApplication>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
auto c = 1;
auto p = reinterpret_cast<char*>(&c);
if(p[0] == 1)
cout << "the system is little endian" <<endl;
else
cout << "the system is big endian" <<endl;
return a.exec();
}