Declarations look like these:
void *malloc(size_t size);
void free(void *pointer)
As far as I can understand, the void *malloc means that malloc returns a pointer to void (“Void pointer”) and free is just void. What’s the difference? Why does it look this way?
The
voidjust means the return type isn’t defined (not a pointer to achar, for example), just a contiguous block of memory of specified size.free()doesn’t return anything. It doesn’t need to.