Name: Anonymous 2011-01-18 22:44
#include <stdlib.h>
int * b;
int main(void)
{
int * a = NULL;
a = (int *) malloc(sizeof(int));
b = &a;
free(b);
return 0;
}Would this result in a memory leak? If yes, why?
#include <stdlib.h>
int * b;
int main(void)
{
int * a = NULL;
a = (int *) malloc(sizeof(int));
b = &a;
free(b);
return 0;
}void* can be implicitly casted to any type. It's like an Any, an Object, an object. It's sepples that sucks so much that even the ``Any'' type must be casted.