The function f
allocates its result always to the same address, that makes the main()
function always print out the same result, how do I make the function allocate the variable an another address and free
them.
int *f(int a) {
int b = 2 * a;
return &b;
}
int main(void) {
int *p4, *p8;
p4 = f(4);
p8 = f(8);
printf("p4: %i / p8: %i\n", *p4, *p8);
}