|
-
April 29th, 2009, 07:25 PM
#1
How to share variables/functions between classes from different files
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?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|