I have a problem which I can't solve. I'm creating an cd class. This cd have 10 char items saved on it. The constructor completes the table.
class CD {
protected:
char* data_ = new char[10];
bool* is_in_ = new bool;
public:
CD() {
for (int i = 0; i < 10; i++) {
cout << "Podaj znak: ";
cin >> data_[i];
}
}
Next I`m creating a child class which can save 20 char items.
class BR : public CD {
protected:
char* improve_data_ = new char[20];
public:
BR() {
for (int i = 0; i < 20; i++) {
cout << "Podaj znak(BR): ";
cin >> improve_data_[i];
}
}
My problem is that when I`m creating an BR object it automally calling cd constructor by which BR object calling cd constructor and its own constructor. My question is that is it possible not to call parent constructor?