Pointer Question.....
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
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement