Answer to Question heap-2

Array A is created in this function's frame in the run-time stack. Since A is destroyed when the function returns, this function returns a dangling pointer.