struct 和 typedef ?

作者: 光明程辉 | 来源:发表于2015-12-10 20:04 被阅读22次

// struct person 类型(相当于 int、double等 用来开辟 空间)

struct person {

  int age;
  char *name;

};

// struct(是指类型),定义一个变量(first)

struct person first;

struct person *ptr;

-------------------

// (每次创建) struct(是指类型),定义一个变量(yj1)

struct yuangong yj1 = {};

相关文章

网友评论

本文标题:struct 和 typedef ?

本文链接:https://www.haomeiwen.com/subject/ecdyhttx.html