Archived

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

Kyo

Quick question about pointers

Recommended Posts

void CClass::copyFrom(const CClass &rhs) { aPointer = rhs.aPointer; } does aPointer point to rhs''s aPointer or does it point to what rhs''s aPointer is pointing to? In other words if the class from which it is copying goes out of scope does the pointer become invalid?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
pPointer = pBointer; 

means that the two pointers point to the same thing.
pPointer = &pBointer; 

means that the first pointer points toward the second one.

Share this post


Link to post
Share on other sites