accessing a base class member in derived class
<p>i have a simple class as below</p>

<pre><code>class A {
        protected:
        int x;
        };

class B:public A
        {
        public:
        int y;
      void sety(int d)
        {
        y=d;
        }
        int gety(){ return y;}
        };

int main()  
{
B obj;
obj.sety(10);
cout&lt;&lt;obj.gety();
getch();
}   
</code></pre>

<p>since the variable A::x has protected access and if i want to access that variable in class B and set a value to it without creating an object of A.Is it possible?if yes then how?</p>

<p>EDIT: can we access the value of A::x using the object of B?like obj.x</p>
