D
D
Hello I'm learning C++ and having done some Asm and C.
I would like input on the following. If I understand what I'm
reading then Objects of a type of class gets a copy of it's class'
(including inherited classes) data members in memory for each
instance of an object.
But all the code, of objects of a type of class
(including inherited classes) is just one copy in memory to be
shared by all the Objects of that type of class.
Even with Virtual functions the same vtable is built and
shared between all objects of that type of class.
Right ? Wrong ? Please explain.
I would like input on the following. If I understand what I'm
reading then Objects of a type of class gets a copy of it's class'
(including inherited classes) data members in memory for each
instance of an object.
But all the code, of objects of a type of class
(including inherited classes) is just one copy in memory to be
shared by all the Objects of that type of class.
Even with Virtual functions the same vtable is built and
shared between all objects of that type of class.
Right ? Wrong ? Please explain.