How to determine the size of the memory allocated by C++ new operator. ?
In C, malloc has the syntax:
void *malloc(size_t size);
here we know what size we are allocating.
but in C++ how can we determine what size is allocated when we do memory allocation as below. I am interested to know how new
determines the size that needs to be allocated.
foo *pFoo = new foo();