title: c: implementation of a rownames function
body: <p>I have a 2d array of pointers (to strings)</p>
  
  <pre><code> char *result[7000][14];
  </code></pre>
  
  <p>I want to write a function that returns the first string in each "row".</p>
  
  <p>Here's what I tried:</p>
  
  <pre><code>char *getRownames (int a, int b, char *matrix[a][b])
  {
      char *rownames[a];
      for(int i=0;i&lt;a;i++){
          rownames[i] = malloc(strlen(matrix[i][0])+1);
          strcpy(rownames[i],matrix[i][0]);
      }
  
      return *rownames;
  }
  </code></pre>
  
  <p>And then </p>
  
  <pre><code> char *names = getRownames(7000, 14, result);
  </code></pre>
  
  <p>I get an error that says conflicting types for getRowNames. Still getting used to C and having to allocate my own memory.</p>