结构体

struct node

{

         int data;

         char sex;

}s1,s2;                         //-------------变量s1,s2

 

typedef struct node

{

         int data;

         char sex;

}SS;                           //-------------类型名SS

 

typedef 存在类型名 自定义类型名

 

结构体指针

typedef struct node

{

         int data;

         struct node* next;           //-------------定义的同时使用

};*pointer;

等价于

typedef struct node* pointer

{

         int data;

         pointer next;               //-------------定义的同时使用

};

等价于

struct node

{

         int data;

         struct node *next;  

};

typedef struct node* pointer;//----------常见的定义方式

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
  • 2021-11-01
  • 2021-11-16
  • 2022-12-23
猜你喜欢
  • 2022-01-09
  • 2022-12-23
  • 2022-12-23
  • 2021-12-20
相关资源
相似解决方案