N
Nick
Why is it that in the example below I get an error saying that I
"cannot access protected member 'i' via a qualifier of type 'Base';
the qualifier must be of type 'Derived'"?? but when i make m_i public
it works fine and i can access the member.
class Base
{
protected int m_i; //doesn't work
//public int m_i; //works
public Base()
{
m_i = 0;
}
}
class Derived:Base
{
public void test(Base b)
{
int test = b.m_i;
}
}
"cannot access protected member 'i' via a qualifier of type 'Base';
the qualifier must be of type 'Derived'"?? but when i make m_i public
it works fine and i can access the member.
class Base
{
protected int m_i; //doesn't work
//public int m_i; //works
public Base()
{
m_i = 0;
}
}
class Derived:Base
{
public void test(Base b)
{
int test = b.m_i;
}
}