Witam!!
Chciałbym zrozumieć, co jest nie tak, w tym prostym kodzie i dlaczego kompilator wyświetla błąd :
"No matching function for call to 'A::A()'
Dodatkowo, błędu nie ma, gdy w konstruktorze klasy bazowej, dam wartość domniemaną dla argumentu.
Proszę o informacje, dlaczego tak się dzieje
#include <iostream>
#include <vector>
using namespace std;
class A
{
protected:
int a;
public:
A(int x):a(x){}
};
class B : public A
{
private:
int x;
public:
B(int c):x(c){}
};
int main()
{
return 0;
}