Answers for "can derived class access base class non-static members without object of the base class"

C++
0

can derived class access base class non-static members without object of the base class

class base
{
public:
    int data;
    void f1()
    {
    
    }
};
class derived : base 
{
public :
     void f()
    {
        base::data = 44; // is this possible
        cout << base::data << endl;
    }
};
Posted by: Guest on January-18-2022

Code answers related to "can derived class access base class non-static members without object of the base class"

Browse Popular Code Answers by Language