Jump to content
  • Advertisement

Archived

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

kenjin

inheritaance issue why do we need objectName() ;

This topic is 5583 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
Advertisement
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
packetPos pos() declares a function called pos that takes no parameters. See http://www.gotw.ca/gotw/001.htm .

Share this post


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

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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!