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
Printable View
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
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!