Witam,
Mam problem z wywołaniem metody z klasy bazowej..
class Zamek {
bool stan;
int l_zasuw;
char *nazwa;
protected:
Zamek(const int l_zasuw, const char *nazwa) {
this->stan = true;
this->l_zasuw = l_zasuw;
this->nazwa = new char[strlen(nazwa) + 1];
strcpy(this->nazwa, nazwa);
}
void Wyswietl() const {
cout << "Nazwa i model: " << this->nazwa << endl;
if (this->stan) cout << "Stan: Otwarty" << endl;
else cout << "Stan: Zamkniety" << endl;
cout << "Liczba zasuw: " << this->l_zasuw << endl;
}
public:
void Zamknij() {
this->stan = false;
}
void Otworz() {
this->stan = true;
}
};
class ZamekSzyfrowy : public Zamek {
char *pin;
public:
ZamekSzyfrowy(const int l_zasuw, const char *nazwa, const char *pin)
: Zamek(l_zasuw, nazwa) {
this->pin = new char[strlen(pin) + 1];
strcpy(this->pin, pin);
}
bool Otworz(const char *pin) const {
if (!strcmp(this->pin, pin)) {
Zamek::Otworz(); // TUTAJ BŁĄD: "the object has tpe qualifiers that are not compatible with the member function "Zamek::Otworz"
return true;
}
else return false;
}
};
Czy ktoś jest wstanie mi wytłumaczyć dlaczego nie mogę się odwołać do tej metody?
Dziękuję, pozdrawiam