I have overloadded operator new[] like this
void * human::operator new[] (unsigned long int count){
cout << " calling new for array with size = " << count << endl ;
void * temp = malloc(count) ;
return temp ;
}
and now calling
human * h = new human[14] ;
say sizeof(human) = 16
, but count it prints is 232 which is 14*16 + sizeof( int * ) = 224+8 .
Why is this extra space being allocated ? And where does it fall in memory ?
Because when I print *h
OR h[0]
I get same results , so its not in beginning of memory chunk. Is it correct at all OR I am missing some thing here ?