[知識復習] 結構體以及結構體指針


結構體

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;//----------常見的定義方式


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM