I am getting "t: undeclared identifier" when a friend class B tries to access it's friend A's protected variable ,t, from within B's function.
I have a class A.h:
friend class B;
In another file, class B.cpp (note that doSomething is a protected function):
cout<< t->isRaining <<endl;
In another file, T.h:
By adding friend class B to the definition of A, aren't all members functions in B able to access all the private and protected members of class A, and hence accessing t should be legit?
I have left out showing what T.cpp and B.h look like since they will not contribute to understanding the problem. Instead, they will just add visual clutter .But they do exist.
what am i doing incorrectly here?