Even I have similar problem:
int *pInt = 0;
int i = 5; /* Local to fun1*/
pInt = &i; /* As I know address of local variable is valid till function execution */
/* fun2 address assign to pfun so that It can be called even after completion of fun1 */
pfun = fun2;
Can someone please explain ? I am getting *pInt value 5.