仲秋花似锦

关注

C program to check little vs. big endian

仲秋花似锦

关注

阅读 13

2024-01-19

void main()
{
        int n = 1;
        // little endian if true
        if(*(char *)&n == 1)
                printf("This is little endian\n");
        else
                printf("This is big endian\n");
}

Suppose we are on a 32-bit machine.
And char type is 8 bits
在这里插入图片描述
在这里插入图片描述

相关推荐

小猪肥

【引用】『转』【大端(Big Endian)与小端(Little Endian)简介】

小猪肥 184 0 0

像小强一样活着

大端小端(Big- Endian和Little-Endian)(转载)

像小强一样活着 95 0 0

残北

基本功练习_2_25_之大端(Big Endian)与小端(Little Endian)

残北 62 0 0

窗外路过了谁

JDK默认是little-endian

窗外路过了谁 67 0 0

四月天2021

LINUX编译OPENJDK:The tested endian intarget (big) differs from the endian expected to be found in the

四月天2021 80 0 0

M4Y

HashSet vs. TreeSet vs. LinkedHashSet

M4Y 103 0 0

芷兮离离

注册中心选型:Eureka vs. Nacos vs. ZooKeeper

芷兮离离 54 0 0

Spinach菠菜

Deno vs. Bun vs. Node.js功能比较

Spinach菠菜 59 0 0

Python百事通

浏览器的数据六种存储方法比较 :LocalStorage vs. IndexedDB vs. Cookies vs. OPFS vs. WASM-SQLite

Python百事通 8 0 0

一脸伟人痣

Python开发IDE的比较:PyCharm vs. VS Code vs. Jupyter

一脸伟人痣 44 0 0

精彩评论(0)

0 0 举报