代码如下:
bool LinkList::inst(int loc,char & el)
{
Node *p = head;
Node *s =new Node;
s->data = el;
if(loc)
{s->next = p->next;
p->next = s;
}
else
{s->next = head;
head = s;
}
return false;
};
头文件:
class LinkList;
class Node
{ friend class LinkList ;
char data;
Node *next;
public:
Node(char d=0,Node *n= NULL):data(d),next(n){};
};
class LinkList :public List
{private:
Node *head;
public:
LinkList(){head=new Node ();};
LinkList(char a[] ,int n);
~LinkList(){delete[] head;};
void init() {delete[] head; head=new Node();};
char gete(int i);
int leng();
int loct (char& el);
bool inst (int loc,char& el);
char dele(int i);
void output();
bool full(){return false;};
bool empt(){return head->next==NULL;};
};
main函数:
LinkList ll(a,5);
ll.output();
ll.inst(3,ch);
ll.output();
运行错误为: fatal error C1083: Cannot open include file: 'Node.h': No such file or directory(在main函数处)
请问代码是哪里出了问题呢?
谢谢各位喽。