相关疑难解决方法(0)

工会成员如何存储?

union test
{
 int i;
 char ch;
}t;
int main()
{
 t.ch=20;
}
Run Code Online (Sandbox Code Playgroud)

假设sizeof(int)==2并且让分配给t的内存地址是2000,2001.
然后在哪里20即t.ch存储 - 在2000或2001或依赖于机器的字节顺序?

c endianness unions

14
推荐指数
1
解决办法
5107
查看次数

标签 统计

c ×1

endianness ×1

unions ×1