R
Rahul
Hi Everyone,
I have the following code,
class sample
{
protected : int i;
private: int j;
public: sample()
{
i = 5;
j = 10;
}
};
class two : public sample
{
public: two()
{
i = 10;
}
friend void test()
{
i = 111;
}
};
And i get an error saying test() cannot access two::sample::i;
Is there any was for the friend function test() to access the
protected members?
Thanks in advance ! ! !
I have the following code,
class sample
{
protected : int i;
private: int j;
public: sample()
{
i = 5;
j = 10;
}
};
class two : public sample
{
public: two()
{
i = 10;
}
friend void test()
{
i = 111;
}
};
And i get an error saying test() cannot access two::sample::i;
Is there any was for the friend function test() to access the
protected members?
Thanks in advance ! ! !