【c++11关键字】 reinterpret_cast
作者:
小鱼号的代码日记 | 来源:发表于
2020-10-28 19:24 被阅读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();
}
本文标题:【c++11关键字】 reinterpret_cast
本文链接:https://www.haomeiwen.com/subject/karymktx.html
网友评论