title: Allocating array of strings
body: <p>Today i was having trouble allocating an array of arrays of char (an array of strings), i wrote this function to do so, but when printing the array, i had some problems with memory ( e.g. Segmentation Fault).
  This was my attempt:</p>
  <pre><code>char **alloca_memoria(char **linguaggio, 
                        int n_sequenze, 
                        int *errore) 
  {
      int i;        
      
      linguaggio = (char**) calloc( n_sequenze,
                                    sizeof(char*));
      
      if (linguaggio != NULL) 
      {      
          for ( i = 0;
                i &lt; n_sequenze;
                i++ )
          {
              linguaggio[i] = (char*) calloc( MAX_SEQ , 
                                              sizeof(char));
              if ( linguaggio[i] == NULL ) 
                  *errore = 1;
              else 
                  *errore = 0;
          }
      }
      else 
          *errore = 1;
  
      return linguaggio; 
  }    
  </code></pre>
  <p>My aim was simply to make it allocate memory and return the value error to check if the allocation was successfull.
  I can't really find what i'm doing wrong.</p>
  <p>p.s. <code>n_sequenze</code> is the actual number of strings, <code>MAX_SEQ</code> is the max size of each string.</p>