title: Returning an array of char pointers
body: <p>I'm trying to return an array of <code>char*</code>'s to a function. I've simplified my code to a test case that clones a char array that instead of containing chars holds pointers to those chars.</p>
  
  <pre><code>/*
   * code.c
   */
  #include &lt;stdio.h&gt;
  
  char* makePointerCopy(char cIn[]);
  
  int main() {
      char cTest[] = {'c', 't', 's', 't'};
      char* cPTest[] = makePointerCopy(cTest);
      printf("%p %c", cPTest, *cPTest);
      fflush(stdout);
      return 0;
  }
  
  char* makePointerCopy(char cIn[]) {
      char* cOut[sizeof(cIn)/sizeof(cIn[0])];
      int iCntr;
  
      for (iCntr = 0; iCntr &lt; sizeof(cIn)/sizeof(cIn[0]); iCntr++)
          cOut[iCntr] = cIn + iCntr;
  
      return cOut;
  }
  </code></pre>
  
  <p>A couple of warnings aside, this is what the compiler has to say about this code snippet:</p>
  
  <blockquote>
    <p>invalid initializer   (at <code>char* cPTest[] = makePointerCopy(cTest);</code>)</p>
  </blockquote>
  
  <p>Why does this happen?</p>