title: Using Dynamic Memory allocation for arrays
body: <p>How am I supposed to use dynamic memory allocations for arrays?</p>
  
  <p>For example here is the following array in which i read individual words from a .txt file and save them word by word in the array:</p>
  
  <p>Code:</p>
  
  <pre><code>char words[1000][15];
  </code></pre>
  
  <p>Here 1000 defines the number of words the array can save and each word may comprise of not more than 15 characters.</p>
  
  <p>Now I want that that program should dynamically allocate the memory for the number of words it counts. For example, a .txt file may contain words greater that 1000. Now I want that the program should count the number of words and allocate the memory accordingly.</p>
  
  <p>Since we cannot use a variable in place of [1000], I am completely blank at how to implement my logic. Please help me in this regard.</p>