Archived

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

inheritaance issue why do we need objectName() ;

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a parent class class packet { etc } ; then a child class class packetPos ublic packet { etc }; it only works when I instantiate an object when I call packetPos pos(); when I use packetPos pos; it gives some linking issue. I don''t know I need to include the (). anyone have any ideas.

Share this post


Link to post
Share on other sites
Need more data. What compiler are you using? Also, post an actual code snippet and the actual errors you are getting. I''d be happy to help, I just need more information.

Share this post


Link to post
Share on other sites
quote:
Original post by Zipster
Since when were function declarations allowed within function blocks? I didn''t know that...


Since C, apparently. See also http://www.gotw.ca/gotw/075.htm for another example.

Share this post


Link to post
Share on other sites
hi here it is

struct ClientPacket
{
ClientPacket();
ClientPacket( char* type );
char* type;
};




struct ClientPosPacket : public ClientPacket
{
ClientPosPacket();
float x,y,z,vel;
};


Share this post


Link to post
Share on other sites