J'écris ce programme de liste chaînée avec C++.
Lorsque je teste le programme, j'obtiens l'erreur suivante
linkedlist.cpp:5:24 : erreur : définition de 'constexpr LinkedList::LinkedList()' implicitement déclaré LinkedList::LinkedList(){
Voici le code
Le fichier linkedlist.h :
#include "node.h"
using namespace std;
class LinkedList {
Node * head = nullptr;
int length = 0;
public:
void add( int );
bool remove( int );
int find( int );
int count( int );
int at( int );
int len();
};
fichier linkedlist.cpp :
#include "linkedlist.h"
#include <iostream>
using namespace std;
LinkedList::LinkedList(){
length = 0;
head = NULL;
}
/*and all the methods below*/
Aidez-nous, s'il vous plaît.