I wrote a program in C having dangling pointer.
#include int *func(void) { int num; num = 100; return # } int func1(void
With dangling pointers, the result of a program is undefined. It depends on how the stack and the registers are used. With different compilers, different compiler versions and different optimization settings, you'll get a different behavior.