I want to share variables/functions between classes. The classes are defined in different .h files. I read that the friend function allows us to do that but I keep getting error messages saying either that the class which holds the data to be shared is not defined or that the function being shared is not a member of the class. From the books and on the internet, the examples are written for classes defined within the same file. Is there a good example on how to do it when the classes are defined in different .h files?