|
-
September 26th, 2008, 02:25 AM
#4
Re: Clarify me on this example
Yes, even i am also thinking the same, becoz i have read many times that we need to use delete only on objects created by using 'new' operator. This is clear to me now.
So it means we should always use in this way
Base *ptr = new Derived();
if we want base class pointer to point to Derived object, am i correct ?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|