对陈小平那个程序片段(无论怎么修改,只要保持InitStack函数)来说,能定义一个变量LStackTp mylist吗?
定义了一个数据类型,却无法定义一个这种数据类型的变量,这算什么事?
你的定义:
typedef struct list_t {
double item;
struct list_t *next;
} list_t;
应改为:
typedef struct node {
int item;
struct node *next;
} *list_t;
陈小平的定义:
typedef struct node
{
DataType data;
struct node * next;
} LStackTp;
应改为:
typedef struct node
{
DataType data;
struct node * next;
} *LStackTp;
并修改相应程序。