title: Returning a character array from a function in c
body: <p>Can I return an array that is created dynamically (using malloc) inside a function back to its caller?</p>
  
  <p>I know that returning a statically allocated array is wrong because the stack unwinds as the function returns and variable is no longer valid but what about a dynamically allocated variable?</p>