title: How to return a char** in C
body: <p>I've been trying for a while now and I can not seem to get this working:</p>
  
  <pre><code>char** fetch  (char *lat, char*lon){
    char emps[10][50];
    //char** array = emps;
    int cnt = -1;
  
    while (row = mysql_fetch_row(result)) 
    { 
      char emp_det[3][20];
      char temp_emp[50] = "";
      for (int i = 0; i &lt; 4; i++){
          strcpy(emp_det[i], row[i]);
      }
  
      if ( (strncmp(emp_det[1], lat, 7) == 0) &amp;&amp; (strncmp(emp_det[2], lon, 8) == 0) ) {
  
          cnt++;
          for (int i = 0; i &lt; 4; i++){
              strcat(temp_emp, emp_det[i]);
              if(i &lt; 3) {     
                  strcat(temp_emp, " ");
              }   
          }
          strcpy(emps[cnt], temp_emp);
      }
    }
  }
  
  mysql_free_result(result);
  mysql_close(connection);
  return array;
  </code></pre>
  
  <p>Yes, I know array = emps is commented out, but without it commented, it tells me that the pointer types are incompatible. This, in case I forgot to mention, is in a char** type function and I want it to return emps[10][50] or the next best thing. How can I go about doing that? Thank you!</p>