typedef

来源:互联网 发布:python re 贪婪匹配 编辑:程序博客网 时间:2024/05/24 07:03

上面的定义结构体方法需要用到struct关键字去构建一个变量,下面的做法可以直接使用Books去定义。
struct Books    {       char  title[50];       char  author[50];       char  subject[100];       int   book_id;    }; struct Books Book1;


 typedef struct    {       char  title[50];       char  author[50];       char  subject[100];       int   book_id;    }Books;  Books Book1, Book2;


0 0
原创粉丝点击