Jump to content
  • Advertisement

Archived

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

Grudgian

Pointer Question.....

This topic is 6349 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

Alright right now I am doing a chapter on Inheritance and I ran across a pointer which confused me, so if anyone can explain what this pointer is doing: Point * pointPtr = 0, p( 30, 50 ); Alright here is what I know, pointPtr is pointing to a Point object. The intialization is what is confusing me. First off why is the 0 there? I know p is a point object and 30, 50 is used in its constructor, but why don''t u have to use new? Thanks, Chris

Share this post


Link to post
Share on other sites
Advertisement
Woah, I must have blanked on that one. I figured the problem which was too easy, but those are usually the ones that get us the best.

Point * pointPtr = 0, // declares and initializes Point pointer to 0.

p( 30, 50 ); //declares p a POINT object and calls constructor.

Wooooo, gotta love it when you get those dense moments.

Thanks again,
Chris

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!