Salut j'ai un petit souci, (erreur de compilation) j'ai une classe qui se compose comme ceci :
Dans mon fichier test.h
***********************
typedef struct _maillon {
int nb;
struct _maillon * suivant;
} maillon;
// Définition de la classe
class CFILE {
public:
//Constructeur
cfile(maillon ** f);
};
Dans mon fichier test.cpp
*************************
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "test.h"
// Constructeur de la classe
CFILE::cfile(maillon **f) {
*f = NULL;
}
// Programme de test
void main () {
maillon * file;
CFILE mafile = new CFILE(&file);
}
et quand je compile j'obtient cette erreur
****************************************
test.cpp(50) : error C2664: '__thiscall CFILE::CFILE(const class CFILE &)' : cannot convert parameter 1 from 'struct _maillon ** ' to 'const class CFILE &'
Reason: cannot convert from 'struct _maillon ** ' to 'const class CFILE'
No constructor could take the source type, or constructor overload resolution was ambiguous
Avez vous une idée ? la je vois pas merci.
Anduril22