SUBNET Solutions interview question

How stack allocated memory gets affected when the pointer is returned from the function.