typedef结构体指针
1.结构体
struct inflatable{
char name[20];
float volume;
double price;
};
声明这个结构体别名Sqlist,或是ArrayList数组
typedef struct{
int data[MAXSIZE];
int length;
}SqList,ArrayList[12];
2.结构体指针
typedef struct LNode{
int data;
struct LNode *next;
}LNode,*LinkList;
声明 struct LNode 为LNode ,或是LinkList指针类型
(1). typedef struct LNode {....}* LinkList
(2)typedef struct LNode {....} LNode
3.LinkTest.cpp
#include[InvalidCharacterError: "stdc++.h" did not match the Name production]
using namespace std;
typedef struct LNode{
int data;
struct LNode *next;
}LNode,*LinkList;
void printL(LinkList t)
{
LNode *p = t;
while(p!=NULL)
{
cout<data<<" ";
p=p->next;
}
cout<<"over!"<[InvalidCharacterError: "ENDL;<" did not match the Name production]