Wow - aggressive downvoting! Give the new person a chance folks!
The answer is "scope". If you compile with gcc, you get a very obvious warning:
C:\tmp>gcc test.c
test.c: In function `func':
test.c:22: warning: function returns address of local variable
The local variable is lost when the function exits and its memory allocation cleaned up.
If you want to return an array from a function you have to malloc
it to create a non-local memory allocation and then return the pointer.