title: Memory Allocation with 2d Character Array
body: <p>So I need to scan in a dictionary of words, max length 19 and dynamically allocate memory to set the size of the dictionary array. I am stuck on how to do this.</p>
  
  <pre><code>fscanf(ifp, "%d", &amp;numwords); //Number of words in dictionary
  
  char ** dictionary;
  
  
  for(i = 0; i &lt; numwords; i++){
      for(j = 0; j &lt; 20; j++){
          dictionary[i][j] = (char *) malloc(20 * sizeof(char));
          fscanf(ifp, "%s", &amp;dictionary[i][j]);
          //printf("%s\n", dictionary[i]); //tests that the letter is read in correctly
      }
  }
  </code></pre>
  
  <p>I am lost on what is wrong. Any help would be greatly appreciated. </p>