I have created few class as below (Since I can not put my real class Here I have written few as just example )
class One {
private :
char *link;
int count
}
class Two {
private :
char *link;
int count
}
class Three :: public TWO {
private :
char *link;
int count ;
One One_object;
}
int main() {
Three test;
cout << test.One_object.link ; // error becoz of accessing private member
}
Here what would be the best way access the private mebers , if it is only value to acess then I could have written a get method function to get the data .
But in my real class has many data members are protected .. Can you somebody through light on this ..