#include #include // for malloc #include #define ARRAY_SIZE 100 int main(int argc, char **argv) { int *p; printf("pre-malloc:\n"); printf("sizeof(p) = %lu\n", sizeof(p)); printf("sizeof(*p) = %lu\n", sizeof(*p)); p = (int*)malloc(ARRAY_SIZE * sizeof(int)); if ( p == NULL ) error(1, 0, "Out of memory!"); printf("\npost-malloc:\n"); printf("sizeof(p) = %lu\n", sizeof(p)); printf("sizeof(*p) = %lu\n", sizeof(*p)); printf("ARRAY_SIZE * sizeof(int) = %lu\n", ARRAY_SIZE*sizeof(int)); // dirty the memory pointed at by p then free it for (int i=0; i