I am getting 18 as answer. Isn't this a case of Dangling pointer? How can i get 18 since p is pointing to something that dose not exist?
#include <stdio.h>
int *func(int, int);
int main()
{
int i = 3, f = 6, *p;
p = func(i, f);
printf("%d\n", *p);
return 0;
}
int *func(int i, int f)
{
int x;
x = i*f;
return(&x);
}