On 30/09/13 08:59, Damien R wrote:

> 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;
> }

Yes, basically that is exactly what happens. The function (with g++) is 
actually called _ZN3Foo5printEv but other than that you have the details 
exactly right.

> If this is the case, can someone give me some resources about the memory
> organisation of c++ and about class/methods generation?

Well strictly speaking those are implementation details which may vary 
from one compiler to another, or at least from one platform to another.

Tom

-- 
Tom Hughes (t...@compton.nu)
http://compton.nu/

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to