kernel 中的c语言学习(零零散散)

来源:互联网 发布:淘宝 便宜 内存卡 编辑:程序博客网 时间:2024/05/16 11:21

1、在GNU C 中可以定以无大小的数组

例题:
        #include <stdio.h>
        int main(int argc,char *argv[ ])
       {
          struct test
          {
               int a ;
               char b[0];
           };
          printf("sizeof(struct test)=%d /n",sizeof(struct test));
        }
执行结果:sizeof(struct test)=4
2
原创粉丝点击