prog.cpp:19:9: error: no matching constructor for initialization of 'Plant'
Plant a("Maple");
^ ~~~~~~~
prog.cpp:4:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'const char [6]' to 'const Plant' for 1st argument
class Plant {
^
prog.cpp:4:7: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided
prog.cpp:21:9: error: no matching constructor for initialization of 'Plant'
Plant b("Maple");
^ ~~~~~~~
prog.cpp:4:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'const char [6]' to 'const Plant' for 1st argument
class Plant {
^
prog.cpp:4:7: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided
prog.cpp:32:9: error: no matching constructor for initialization of 'Fruit'
Fruit c("Apple","sweet");
^ ~~~~~~~~~~~~~~~
prog.cpp:11:7: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided
class Fruit: public Plant {
^
prog.cpp:11:7: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 2 were provided
prog.cpp:34:9: error: no matching constructor for initialization of 'Fruit'
Fruit d("Apple","sweet");
^ ~~~~~~~~~~~~~~~
prog.cpp:11:7: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided
class Fruit: public Plant {
^
prog.cpp:11:7: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 2 were provided
4 errors generated.