hi I'm using inheritance in my code yet I get an error everything looks fine to me but it's not fine to the compiler the error I'm getting is undefined reference to 'vtable for cat yet this only happens when I try to declare my class cat in main.any ideas yo why this is happening?
#include <iostream>
#include <vector>
usingnamespace std;
class animal{
public:
virtualvoid makeSound(){};
void Iam(){
cout << "I m just an animal" << endl;
}
};
class cat: public animal{
public:
void makeSound();
};
int main()
{
cat c;
}
does anybody else know why the function makeSound won't get called in the for loop it gives me an error a very very long one,yet pretty much the same code will work for the author in the book