You have posted it as an Article under the Article / Source code section. I have moved it to the Queries and Discussion forum.

Duplicate of Returning pointer to local variable. Thread closed.