
求编程高手~!~!出现cannot convert `LNode*' to `int*' in initialization
StatusClearList(LinkList&L){//TODO(#1#):清空表//将单链表重新置为一个空表while(L->next){int*p=L->next...
Status ClearList(LinkList &L)
{
// TODO (#1#): 清空表
// 将单链表重新置为一个空表
while (L->next)
{
int *p=L->next;
L->next=p->next;
free(p);
}
typedef struct LNode {
ElemType data;
struct LNode *next;
} LNode, *LinkList;
描述 资源 路径 位置 类型
cannot convert `LNode*' to `int*' in initialization linklist.h /链表 第 100 行 C/C++ Problem 展开
{
// TODO (#1#): 清空表
// 将单链表重新置为一个空表
while (L->next)
{
int *p=L->next;
L->next=p->next;
free(p);
}
typedef struct LNode {
ElemType data;
struct LNode *next;
} LNode, *LinkList;
描述 资源 路径 位置 类型
cannot convert `LNode*' to `int*' in initialization linklist.h /链表 第 100 行 C/C++ Problem 展开
1个回答
展开全部
Status ClearList(LinkList &L)
{
while (L->next)
{
LNode *p=L->next;//<-错在这里,节点是LNode类型的,不能用int型的指着来指
L->next=p->next;
free(p);
}
typedef struct LNode {
ElemType data;
struct LNode *next;
} LNode, *LinkList;
{
while (L->next)
{
LNode *p=L->next;//<-错在这里,节点是LNode类型的,不能用int型的指着来指
L->next=p->next;
free(p);
}
typedef struct LNode {
ElemType data;
struct LNode *next;
} LNode, *LinkList;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询