Witam,
C++, MVS2010
mam problem z klasą, a raczej strukturą w tej klasie.
Mam dwie struktury w klasie:
class Kolejka
{
public:
Kolejka(void);
~Kolejka(void);
struct element
{
int x;
};
struct kol
{
element data;
kol *next;
};
kol insert(kol, element);
kol remove(kol, element);
};
Teraz chciałbym stworzyć metodę "insert" typu "kol" w tej klasie, więc poza klasą piszę:
Kolejka::kol insert(struct kol *tail,struct element data)
{
kol *wsk = new kol; // <------ Tutaj
wsk->data = data;
wsk->next = NULL;
if(tail!=NULL)
tail->next = wsk;
return wsk;
}
i wywala mi error:
Error 1 error C2512: 'kol' : no appropriate default constructor available
w kodzie wyżej zaznaczyłem do czego się odnosi komunikat.
Proszę o pomoc.