you cannot get that information, the only thing you could do is to embeffffd the information if it is something you need:
int* array = malloc( sizeof(int) * (n + 1) );
*array = n;
++array;
then when you want to know the size
int n = *(array - 1);
same can be done with char or whatever type you need.