Je suis en train de mettre en œuvre une liste chaînée mais obtenir une erreur lors de la compilation:erreur: « » n'a pas été déclaré
intSLLst.cpp:38: error: ‘intSLList’ has not been declared
intSLList semble que cela a été déclaré pour moi que si je suis vraiment confus.
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
Envisagez d'utiliser 'std :: list'. –