Pregunta de entrevista de Microsoft

Phone interview question: In C, why is it considered bad form for a function to return a pointer to a stack-allocated variable? What happens if you do it anyway?

Respuesta de la entrevista

Anónimo

5 may 2009

Here's a hint: You can actually do this in C, and your program will work okay... for a while. The data that your pointer points to will not be corrupted until your program performs a certain action.

1