title: Passing an array of strings as parameter to a function in C
body: <p>I want a simple function that receives a string and returns an array of strings after some parsing. So, this is my function signature:</p>
  
  <pre><code>int parse(const char *foo, char **sep_foo, int *sep_foo_qty) {
      int i;
      char *token;
      ...
      strcpy(sep_foo[i], token); /* sf here */
      ...
  }
  </code></pre>
  
  <p>Then I call it like this:</p>
  
  <pre><code>char sep_foo[MAX_QTY][MAX_STRING_LENGTH];
  char foo[MAX_STRING_LENGTH];
  int sep_foo_qty, error;
  
  ...
  
  error = parse(foo, sep_foo, &amp;sep_foo_qyt);
  
  ...
  </code></pre>
  
  <p>This way I get a warning during compilation:</p>
  
  <pre><code>warning: passing argument 2 of 'parse' from incompatible pointer type
  </code></pre>
  
  <p>And then a segmentation fault during execution in the line marked with /* sf here */</p>
  
  <p>What is wrong in my C code?</p>
  
  <p>Thanks in advance</p>