title: c array malloc unknown size
body: <p>How can I create an array of unique strings without knowing how many strings there are until I process the input file? There can be as many as 2 million strings, max length of 50.
  My program is something like this. This works for 51 items then overwrites other data. I don't know how to add an element to the array, if possible.</p>
  
  <pre><code>main() {
  
      char *DB_NAMES[51]; // i thought this gave me ptrs to chunks of 51
                  // but it's 51 pointers!
      char *word;
  
      while not eof {
          ...function to read big string 
          ...function to separate big sting into words
          ...
          processWord(ctr, DB_NAMES, word);
          ...
      }
  }
  
  processWord(int ndx, char *array1[], char *word){
  
      ...function to find if word already exists...
  
      //if word is new, store in array 
          array1[ndx]= (char *)malloc(sizeof(51)); // isn't this giving me a char[51]?    
          strcpy(array1[ndx],word);
      ...
  }
  </code></pre>