typedef 一个struct

下面的struct:


struct node

{

int data;

struct node * next;

};


要用的时候,必须这样调用:

struct node n1;

struct node *n2;


简单化方法:

typedef struct node

{

int data;

struct node *next;

} Node, *pNode;


使用的时候:

Node n1;

pNode n2;


这样比较简单



你可能感兴趣的:(typedef 一个struct)