Od początku. Mam klasę kotów. Problem tego typu: usuwanie obiektów. Gdy wpiszę imię takie jakie mam obiektu dodanego, gdy wpiszę innego wywala mi błąd. Może ktoś potrafi pomóc.
Dziedziczenie * pom = nast;
Dziedziczenie * pom2 = nast;
if (pom != NULL && pom->kot == kot)
{
nast = nast->nast;
}
else
{
while(pom2->nast !=NULL && pom2->nast->kot != kot)
{
pom = pom->nast;
}
if (pom2==NULL)
{
cout << "Nie mozna usunac kota\n";
return;
}
pom = pom2->nast;
pom2->nast = pom2->nast->nast;
}
cout << "\n\tKot :\n"<<endl;
kot->pokaz();
cout << "\n\tSkasowany"<<endl;
delete pom->kot;
delete pom;
ilosc--;
}
streamsize _Count = (streamsize)_Traits::length(_Val); // may overflow
streamsize _Pad = _Ostr.width() <= 0 || _Ostr.width() <= _Count ? 0 : _Ostr.width() - _Count;
const typename _Myos::sentry _Ok(_Ostr);