typedef 一个struct

来源:互联网 发布:access数据库管理软件 编辑:程序博客网 时间:2024/04/29 03:17

下面的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;


这样比较简单



0 0