How is it possible to get the size of memory allocated knowing only the pointer name returned by malloc function ? I suppose it is possible because free function as only this pointer as parameter but I do not know how to do that.
size_t myfoo (void *ptr) {
/* some instruction to get the size : This is the question*/ }
main () {
int * ptr;
ptr=malloc(100);
printf("%ud \n",myfoo(ptr)); }