1.
struct s
{ int x:3;
int y:4;
int z:5;
double a;
};
求sizeof(s)
解答:16. 是取位的作用,前三个变量是为两个字节,最后double变量是8个字节,
结构体以8字节对齐,则为16字节。
2.
#include <stdio.h>
int main()
{
int a = 0256;
int b = 256;
printf("%o %o\n", a, b);
}
输出为:256,400