title: How to properly deference a char** pointer passed as an address to functions?
body: <p>I am writing a program that uses char ** to setup a multidimensional array.
  I then pass the address of the char ** to another function to play with.</p>
  <p>How do I properly deference ** pointers after they have been passed via address to another function?</p>
  <blockquote>
  <p>ERROR<br />
  array of c string<br />
  Segmentation fault</p>
  </blockquote>
  <pre><code>int test(char *** strings){
      puts(*strings[0]);
      puts(*strings[1]);
      return 1;
  }
  
  int main(void) {
  
      char arr[][25] =
      { &quot;array of c string&quot;,
      &quot;is fun to use&quot;,
      &quot;make sure to properly&quot;,
      &quot;tell the array size&quot;
      };
      
      
    char ** strings = (char**)malloc(2 * sizeof(char*));
    
    strings[0] = (char*)malloc(25 * sizeof(char));
    strcpy(strings[0], arr[0]);
    
    strings[1] = (char*)malloc(25 * sizeof(char));
    strcpy(strings[1], arr[1]);
    
    test(&amp;strings);
  
    return 1;
  }
  </code></pre>
  <p>*Mallocs are casted incase someone plugs this into a C++ playground</p>