title: Returning Arrays/Pointers from a function
body: <p>I am trying to create a new integer array which is derived from a string of characters. For example :</p>
  
  <pre><code>char x[] = "12334 23845 32084";  
  
  int y[] = { 12334, 23845, 32084 };
  </code></pre>
  
  <p>I am having trouble understanding how to return an array ( which I understand isn't possible ) from a function. </p>
  
  <p>I originally tried :</p>
  
  <pre><code>/* Convert string of integers into int array. */
  int * splitString( char string[], int n )
  {
      int newArray[n];
  
      // CODE
  
      return ( newArray );
  }
  
  int main( void )
  {
      int x[n] = splitString( string, n );
  
      return ( 0 );
  }
  </code></pre>
  
  <p>I later learned that you can not do this. </p>
  
  <p>How do pointers work in regards to functions?</p>
  
  <p>Thank you.</p>