vPtr
points to a memory area containing the address of the virtual function table, in VS2010, the virtual function table takes 4 bytes of memory - sizeof(*void), the table stores the addresses of virtual functions
1) the constructor of the object in the heap is called
2)vPtr
is initialized with a pointer to the address of the ob
object table
3) the function f()
is called at the address passed to the vPtr
structure
4) the memget()
function is called, which stores the size of the object
5) virtual destructor is called
Войдите чтобы поставить Нравится
Войдите чтобы прокомментировать