#include #include int *foo(void) { int *ptr = 0; for (int i = 0; i < 5; i++) { ptr = calloc(1, sizeof(*ptr)); } ptr = calloc(1, sizeof(*ptr)); ptr = calloc(1, sizeof(*ptr)); *ptr = 5; return ptr; } struct bar { int x; int *y; }; int *bar(void) { struct bar bar; bar.x = 5; bar.y = calloc(1, sizeof(int)); *bar.y = bar.x; return bar.y; } int main(void) { int *x = foo(); printf("Result of foo(): %d\n", *x); x = bar(); printf("Result of bar(): %d\n", *x); return 0; }