Tech Mahindra interview question

dangling Pointers? c++ code snippets