cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
interrelated friend classes
interrelated friend classes
Nov 24, 2010 at 1:58pm UTC
flide
(5)
is it possible for 2 classes access the private data members of each other without being related in any way(I mean inheritance) and still have privacy as far as other classes are concerned... something like friend functions ----> friend classes.
Nov 24, 2010 at 2:12pm UTC
Bazzy
(6281)
you can have friend classes
Nov 24, 2010 at 2:22pm UTC
stravant
(53)
1
2
3
4
5
6
7
class
a {
friend
class
b; };
class
b {
friend
class
a; };
Is the syntax you're looking for. It works just like a friend function.
Nov 24, 2010 at 4:19pm UTC
flide
(5)
that works?? really??
I am such a dumb ass, I should have thought about it...
Thanx... :)
Topic archived. No new replies allowed.