0
Can protected data accessed in derived class? If yes...then how??
2 ответов
+ 1
What do you mean how? A protected member of a base class is usable in the derived class, just as if it was public to that derived class only.
class Animal
{
protected:
short legs;
};
class Dog : public Animal
{
public:
Dog()
{
legs = 4;
}
};
0
definitely only private you cant use in derived class.
you can use direct as you are using in base class.
but form the another function you cant use.