Pl see the following code-
class A
{
public:
void show(){cout<<"hello"<<endl;}
};
class B
ublic A
{
private:
A::show;
};
main()
{
B b;
b.show();// should be an error
}
now when i try to access show direclty from a B obj in main
this should give error, as I have changed its access for
class B to private.
( as per C++ FAQ
http://vision.eng.shu.ac.uk/C++/c++/...heritance.html),
but the above piece of code works fine with
Linux/gcc/g++,
any help to understand this is appriciated.
Thanks
Aashish