Woodward Interview Question

This was a small c function that returns a pointer to a character in a buffer. Find the problem.

Interview Answer

Anonymous

Nov 4, 2011

The problem was the function returned a pointer that was declared locally (it would be on the stack) and it would be invalid after the function returns.