Re: Is MSDN wrong? or I made a mistake? about static member function
- From: Eberhard Schefold <eberhard.schefold@xxxxxxxxxxxx>
- Date: Wed, 12 Jul 2006 15:52:12 +0200
David Ching schrieb/wrote:
On the contrary, p1->x makes it easy to see p1 was allocated on the heap and needs to be deleted or otherwise memory managed. p1.x does not.
I don't understand. Given a pointer, there's no telling whether the object pointed to resides on the heap or on the stack.
struct S { int x; int y; };
S s;
S* p1 = &s;
int n = p1->x;
delete p1; // of course NOT
.
- Follow-Ups:
- Re: Is MSDN wrong? or I made a mistake? about static member function
- From: Tom Serface
- Re: Is MSDN wrong? or I made a mistake? about static member function
- References:
- Re: Is MSDN wrong? or I made a mistake? about static member function
- From: Doug Harrison [MVP]
- Re: Is MSDN wrong? or I made a mistake? about static member function
- From: David Ching
- Re: Is MSDN wrong? or I made a mistake? about static member function
- From: Doug Harrison [MVP]
- Re: Is MSDN wrong? or I made a mistake? about static member function
- From: Joseph M . Newcomer
- Re: Is MSDN wrong? or I made a mistake? about static member function
- From: David Ching
- Re: Is MSDN wrong? or I made a mistake? about static member function
- Prev by Date: Re: replacing unsigned char * with CString
- Next by Date: Re: replacing unsigned char * with CString
- Previous by thread: Re: Is MSDN wrong? or I made a mistake? about static member function
- Next by thread: Re: Is MSDN wrong? or I made a mistake? about static member function
- Index(es):
Relevant Pages
|