/* * malloc and free use example */ #include #include int main(void) { int *p; p = (int *) malloc(sizeof(int)); if (p == NULL) { printf("ERROR: Out of memory\n"); return 1; } *p = 5; printf("%d\n", *p); free(p); return 0; }