See this example!
int main( int argc, char ** argv ) { int *ptr = malloc(100 * sizeof (int)); printf(\"sizeof(array) is %d bytes\\n\", sizeof(ptr)
You cannot print the size of the memory block you received. Either malloc allocates all the memory you requested or it does not (and returns NULL).
NULL
The sizeof() operator does what you request: it tells you the size of the pointer - and the pointer itself occupies 4 bytes in memory.