let say we have class Animal and class Dog that derived from Animal
now let say i will creat an Animal pointer that will point to new DogCode:class Animal { private : int age; public: Animal(); ....... }; class Dog:public Animal { private : string wayOfBirth; public dog() void setBirth(const string& birth) ; string getBirth() const; };
Animal* bluh = new Dog();
- can this pointer access (void setBirth(const string& birth); )
bluh->setBirth(string)................?
if not how can i access it?