Why does compiler complain:
warning: address of local variable 'newList' returned

I thought we could return values b/c in fact we are returning a copy of it.

Code:
int* newList(int* list, int size)
{
 int newSize = size * 2;
 int newList[] = {};
 
 for ( int i = 0; i < newSize; ++i )
  list[i] = 0;
 
 return newList;
}