I apologize if my question will appear a bit silly for someone. But I'm just a beginner.
My problem is that I get a segmentation faulior when I try to run a program which contains 1 derived class and 2 base classes. Input should be performed by derived class.
But this is where I get the mistake. Actually the program compiles but when I try to input the first value segmentation fault error occurs. And I can’t trace the mistake.
Does anybody know what might be the problem?
Many thanks in advance!
Compiling? getName method doesn't return a string?
You should use "virtual" keyword in base class(Animal class is base class. Dog and Cat classes are derived classes. So you have 2 derived and 1 base class) for overloaded methods.