This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
pointers to object questions
- From: Andre Kirchner <supercroc1974 at yahoo dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Wed, 21 Jul 2004 08:57:58 -0700 (PDT)
- Subject: pointers to object questions
Hi,
I have a program that instantiates a Connector object,
and then a Sender object passing a pointer to the
Connector object as a parameter.
Connector theConnector;
Sender theSender( &theConnector );
When the object Sender is instantiated, it
instantiates a Data object passing again the same
pointer to the Connector object.
Sender::Sender( Connector * newConnector )
{
theConnector = newConnector;
Data theData( newConnector );
}
When the methods of the Sender object use the
Connector object, I don't have any problem, but for
some reason it doesn't work, when the methods of Data
try to use the Connector object. Do you guys have any
idea about what could be wrong?
This is the constructor of the Data class if it might
help:
Data::Data( Connector * newConnector )
{
theConnector = newConnector;
}
Thanks a lot,
Andre
__________________________________
Do you Yahoo!?
Vote for the stars of Yahoo!'s next ad campaign!
http://advision.webevents.yahoo.com/yahoo/votelifeengine/