Witam mam problem z metodą kopiowania klasy pochodnej w poniższym kodzie
Cd- klasa bazowa
Classic - klasa pochodna
w załączniku kod programu, z góry dzięki za pomoc
Pozdrawiam
Krzysiek
Cd & Cd::operator=(const Cd & d)
{
if (&d == this)
return *this;
strcpy_s(performers, strlen(d.performers)+1, d.performers);
strcpy_s(label, strlen(d.label)+1, d.label);
selections = d.selections;
playtime = d.playtime;
return *this;
}
//metody klasy Classic
Classic & Classic::operator=(const Classic & c)
{
if (&c == this)
return *this;
Cd::operator=(c);
delete [] main_record; **<--- w tym miejscu przerywa się progra```
main_record = new char[strlen(c.main_record) + 1];
strcpy_s(main_record, strlen(main_record)+1, c.main_record);
return *this;