I have to implement a function that returns the memory address of a pointer when I allocate it with malloc(). I know that malloc(value) allocates an area on the heap which is of size value.
I know how to implement the code for printing the memory address of that pointer:
void *s = malloc (size)
printf("%p\n",s);
My question is, how can I save the value printed by that code in an int or string (e.g. char *)?