zoukankan      html  css  js  c++  java
  • 大小端

    记录网友的大小端两种 验证方式:

    #include<iostream>
    using namespace std;
    int main()
    {
    int intBit = 0xABCD;
    const char* testBit = (char *)(&intBit);
    cout << hex;
    cout << "内存中整数intBit的内容为:";
    cout << (int(testBit[0]) & 0xff) << " ";
    cout << (int(testBit[1]) & 0xff) << " ";
    cout << int(testBit[2]) << " ";
    cout << int(testBit[3]) << endl;

    return 0;
    }

    /////////////////////////////////////////////////////////////////////////////////////////////////

    #include<iostream>
    using namespace std;
    union Endian
    {
    short data;
    char ch[2];
    };
    int main()
    {
    Endian end;
    end.data = 0xABCD;
    cout << hex;
    cout << (end.ch[0] & 0xff) << " " << (end.ch[1] & 0xff) << endl;
    return 0;
    }

    https://blog.csdn.net/cylj102908/article/details/78697249

  • 相关阅读:
    javascript生成二维码
    Gulp--Less
    自动构建工具Gulp
    上传文件返回数据提示下载
    svg
    Grunt--Less
    node.js--Less
    浏览器端Less
    HTML5表单
    node.js模块依赖及版本号
  • 原文地址:https://www.cnblogs.com/tiange-137/p/11887335.html
Copyright © 2011-2022 走看看