Lat us take a class like
Code:
class A
{
int *i;
char *c;
A()
{
i = (int*) malloc( 50 * sizeof(int));
c = (char*) malloc(100);
}
};
My question is how to know how much memory is the object actually dealing with..
i mean in this case
2pointrs = 8 bytes
memory allocated for i = 50 * 4 = 200 bytes
for c = 100 bytes
In total 308 bytes..
Is there any function we can use to get this 308 as the answer...
If we are creating some other objects in this class, then that memory also has to include..




I thought Code Blocks IDE..