闭关修行中......
The declaration of the function and the signature of the defined function are different, so it is strange to succeed. . .
Status InitList_L(LinkList,ElemType *);//创建带头节点的单链表 -- 这是你的声明 Status InitList_L(LinkList &L,ElemType *ptr) // !!! 第一个参数不同 -- 定义却是这样的
Please try changing fun.cpp to declare.cpp
The function declared in your declara.h has a different signature than the function you implemented in fun.cpp, and it will definitely fail
//declar.h Status InitList_L(LinkList,ElemType *);//创建带头节点的单链表 Status ListInsert_L(LinkList,int,ElemType);//在链表元素i前插入元素e Status ListDelete_L(LinkList,int,ElemType);//删除第i个节点,用e带回 ElemType FindData_L(LinkList,ElemType);//查找元素n void MergeList_L(LinkList,LinkList);//合并两个链表 void ListTraver_L(LinkList);//打印链表元素 void InputList_L(ElemType *);//输入数据
//declar.h //修改之后 Status InitList_L(LinkList &, ElemType *);//创建带头节点的单链表 Status ListInsert_L(LinkList &, int, ElemType);//在链表元素i前插入元素e Status ListDelete_L(LinkList &, int, ElemType &);//删除第i个节点,用e带回 ElemType FindData_L(LinkList, ElemType);//查找元素n void MergeList_L(LinkList &, LinkList &);//合并两个链表 void ListTraver_L(LinkList);//打印链表元素 void InputList_L(ElemType *);//输入数据
The declaration of the function and the signature of the defined function are different, so it is strange to succeed. . .
Please try changing fun.cpp to declare.cpp
The function declared in your declara.h has a different signature than the function you implemented in fun.cpp, and it will definitely fail