pointers to object questions

Andre Kirchner supercroc1974@yahoo.com
Wed Jul 21 15:58:00 GMT 2004


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/



More information about the Gcc-help mailing list