I have written the following code in C:
#include <stdio.h>
#include <stdlib.h>
int main (int argc , char *argv[]) {
int * ptr = (int *)malloc(sizeof(int));
int three = 3;
ptr = &three;
free(ptr);
return EXIT_SUCCESS;
}
When I execute I get following error:
Abort signal from abort(3) (SIGABRT).
Could you help me find my mistake? Thank you!