c – error:”尚未声明

c – error:”尚未声明,第1张

概述我正在尝试实现链接列表,但在编译时会收到错误: intSLLst.cpp:38: error: ‘intSLList’ has not been declared intSLList看起来像已经被声明给我,所以我真的很困惑. intSLLst.cpp #include <iostream>#include "intSLLst.h"int intSLList::deleteFromHead( 我正在尝试实现链接列表,但在编译时会收到错误:

intsllst.cpp:38: error: ‘intSLList’ has not been declared

intSLList看起来像已经被声明给我,所以我真的很困惑.

intsllst.cpp

#include <iostream>#include "intsllst.h"int intSLList::deleteFromhead(){}int main(){}

intsllst.h

#ifndef INT_linkED_List#define INT_linkED_List#include <cstddef>class IntsllNode{  int info;  IntsllNode *next;  IntsllNode(int el,IntsllNode *ptr = NulL){    info = el; next = ptr;  }};class IntSLList{ public:  IntSLList(){    head = tail = NulL;  }  ~IntSLList();  int isEmpty();  bool isInList(int) const;  voID addTohead(int);  voID addToTail(int);  int deleteFromhead();  int deleteFromTail();  voID deleteNode(int); private:  IntsllNode *head,*tail;};#endif
解决方法 你在使用小写字母我
int intSLList::deleteFromhead(){}

应该

int IntSLList::deleteFromhead(){}

c中的名称总是区分大小写.

总结

以上是内存溢出为你收集整理的c – error:”尚未声明全部内容,希望文章能够帮你解决c – error:”尚未声明所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/1232851.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-06
下一篇 2022-06-06

发表评论

登录后才能评论

评论列表(0条)

保存