#include #include // for malloc #include #define ARRAY_SIZE 100 int main(int argc, char **argv) { int *p; printf("pre-malloc:\n"); printf("p = %p\n", p); p = (int*)malloc(ARRAY_SIZE * sizeof(int)); if ( p == NULL ) error(1, 0, "Out of memory!"); printf("\npost-malloc:\n"); printf("p = %p\n", p); free(p); printf("\npost-free:\n"); printf("p = %p\n", p); return 0; }