📌  相关文章
📜  教资会网络 | UGC NET CS 2018 年 7 月 – II |问题 4

📅  最后修改于: 2022-05-13 01:57:55.763000             🧑  作者: Mango

教资会网络 | UGC NET CS 2018 年 7 月 – II |问题 4

以下“C”程序的输出是什么? (假设多字节数据的 little-endian 表示,其中最低有效字节 (LSB) 存储在最低内存地址。)

#include 
#include 
/ * Assume short int occupies two bytes of storage */
int main ( )
{
union saving
{
short int one;
char two[2];
};
union saving m;
m.two [0] = 5;
m.two [1] = 2;
printf(’’%d, %d, %d\n”, m.two [0], m.two [1], m.one);
}/ * end of main * /

(一) 5、2、1282
(B) 5、2、52
(C) 5、2、25
(D) 5、2、517答案: (D)
解释:
这个问题的测验