Possible Duplicate:
How are objects stored in memory in C++?
For example a C++ class:
class A{ int value; void addOne(){ value++; } }
Will an instance of class A be loaded like this [pseudo code]:
[identifier of A] [this is int value] [this is void addOne(void)][value++]Or like this:
[members identifier of A] [this is int value]Second should use less memory on multiple instances of a class. Because the same functions are used for all instances. How is the memory handled in C++? Is it possible to change memory handling?[functions identifier of A] [this is void addOne(ref to member of A)][A.value++]