1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include <iostream> using namespace std; class Animal { int fecNac; public: Animal(int fn) { fecNac=fn; } void verFecNac() { cout << fecNac << endl; } }; class Mamifero : public Animal { }; int main() { Mamifero foca(12); foca.verFecNac(); }
1 2 3
In function 'int main()': Line 15: error: no matching function for call to 'Mamifero::Mamifero(int)' compilation terminated due to -Wfatal-errors.