// in bar.h class bar { private: char* endofroad = 'a'; public: char* getEndofRoad() { return endofroad; }; }; // in foo.h class foo { private: bar* test; public: char* getTest() { test->getEndofRoad(); }; }; // in test.cpp #include #include "bar.h" #include "foo.h" using namespace std; int main( int argc, char* argv[] ) { cout << foo::getTest() << endl; return 0; }