Woo, I am glad I found this forum, I am having some problems with class inheritance. I am completely confused why public items are inaccessible in the following highly compressed example
, help would be greatly appreciated.
class BaseTest
{
public:
int t1;
};
class Derived1 : BaseTest
{
public:
int t2;
};
main()
{
Derived1* thetest = new Derived1;
thetest->t1 = 101;
thetest->t2 = 102;
};
Errors from gcc:
test.cpp: In function `int main()':
test.cpp:8: `int BaseTest::t1' is inaccessible
test.cpp:22: within this context