|
From: Damien R <dam...@gm...> - 2013-09-30 08:00:30
|
On 09/29/2013 02:22 PM, Tom Hughes wrote:
> Yes. Nothing in the "foo->print()" call actually accesses any memory
> that was part of the object.
>
> The body of the function doesn't access any member variables, and it's
> not a virtual function so the vtable is not read, so there is no
> access to any freed memory.
>
> Tom
>
Thanks to everyone who answered the question but I still do not
understand why foo->print() does work. For me foo is part of the object
because it is the object. Does it mean that the method print is
generated like:
void print(Foo *)
{
std::cout << "foo" << std::endl;
}
If this is the case, can someone give me some resources about the memory
organisation of c++ and about class/methods generation?
Regards,
Damien R.
|