The trick lies in the fact that when the control returns from the m function, all memories allocated to the variables during execution of m function are cleared. So, even though address of a is returned, this memory location no longer contains data of array a. So, there will be a segmentation fault.