1.How does inheritance influence the working of constructors and destructors?
2.Find the syntax error(s) (if any) in the following
code and correct them:
class ABC
{
int x= 10;
float y,
public:
ABC() {y=5;}
~() {}
}
void main ()
Answers
Answered by
29
Hello
Constructors and destructors obey the same access rules as member functions. ... Derived classes do not inherit or overload constructors or destructors from their base classes, but they do call the constructor and destructor of base classes. Destructors can be declared with the keyword virtual
Thanks
Plz mark me as brain liest
mannatmarya:
Thanks
Answered by
5
What I don't understand which class is it this question
Similar questions