So if you use a pointer you do not need to make the other class a friend...?
yes I see I was wrong. A class just defines a type, and since you are not
needing your class (A) to use the methods and members of B you don't need to
use friend.
ah.
Daniel
>From: Per Westermark <pw...@ia...>
>To: FABIAN HUENUMAN <fhu...@ho...>
>CC: dev...@li...,
><dev...@li...>
>Subject: Re: [Dev-C++] CROSS REFERENCE WITH OBJECTS
>Date: Mon, 9 Feb 2004 10:13:49 +0100 (CET)
>
>class A;
>class B;
>
>class A {
> protected:
> B *ptr_to_B;
>};
>
>class B {
> protected:
> A &ref_to_A;
>};
>
>/Per W
>
>On Sun, 8 Feb 2004, FABIAN HUENUMAN wrote:
>
> > Hello!
> >
> > i have a question about c++, how can I declare that an object A has a
> > reference to an object B, and this object B has a reference to A? it
>this
> > posible.
> > Thanks for the attention.
> >
> > _________________________________________________________________
> > MSN Amor: busca tu ½ naranja http://latam.msn.com/amor/
> >
> >
> >
> > -------------------------------------------------------
> > The SF.Net email is sponsored by EclipseCon 2004
> > Premiere Conference on Open Tools Development and Integration
> > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
> > http://www.eclipsecon.org/osdn
> > _______________________________________________
> > Dev-cpp-users mailing list
> > Dev...@li...
> > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
> >
>
>
>
>-------------------------------------------------------
>The SF.Net email is sponsored by EclipseCon 2004
>Premiere Conference on Open Tools Development and Integration
>See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
>http://www.eclipsecon.org/osdn
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
_________________________________________________________________
Tired of 56k? Get a FREE BT Broadband connection
http://www.msn.co.uk/specials/btbroadband
|