Jump to content
  • Advertisement


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


Pointer Question.....

This topic is 6267 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
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,

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!