how to access protected functions in c++



                        

#include<iostream>
#include<conio.h>
using namespace std;
class animal
{
  protected:
            string name;
      void   SetAnimal(string n)
         {
         name=n;
         }     
         public:
         string  GetAnimal()
         {
              SetAnimal("All Animals");
              return name;
         }
};
class cat:public animal
{
protected:
          string name;
     void SetCat(string n)
     {
          name=n;
          }     
public:
string GetCatNAme()
{
       SetCat("Billi");
return name;
}
};

int main()
{
    animal an;
    cout << "--------------------------"<< endl;
    cout << an.GetAnimal() << endl;
    cout << "--------------------------"<< endl; 
    cat ct;
    cout << ct.GetCatNAme()<< endl;
    cout << "--------------------------"<< endl;
    getch();
    return 0;
    }