#### Archived

This topic is now archived and is closed to further replies.

# C++ class question.

This topic is 5743 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

How do I get 2 seperate classes to be totally public to each other. I want them to be exactly like they were in the same class together. I could just copy and paste them into the same file but then the file would be confusing and huge. I dont want to use a hierchy because I dont want 1 class to be public to the other. I want them both to be public to each other. I guess i want a friend class but from my understanding of the friend operator it just makes the class external and then basically open to everyone. Maybe im wrong with this as i have only used friend calls for over assigning operator functions. How would you go about doing this?

##### Share on other sites
class Alpha {  friend class Beta;  int a;};class Beta {  friend class Alpha;  int b;};

?