Click to See Complete Forum and Search --> : MEMORY ALLOCATION


manisha banerjee
June 22nd, 1999, 02:20 AM
please answer me this question:

how is the memory allocated for this:

class A
{
int a;
int b;
float c;
void finc();
virtual func1();
}

A *ptr = new A

real name
June 22nd, 1999, 03:49 AM
if you wondering that
sizeof(A) is bigger than sizeof(a)+sizeof(b)+sizeof(c)
it is because virtual-table added to structure
but if is at start or end and how are real sizes of items and whole strucure it depends on compiler, os, no/debug
maybe this helps you
t!