title: Add item to empty array in C and getting array length
body: <p>I've taking many attempts at solving this problem but failed every time.</p>
  
  <p>I have an array</p>
  
  <pre><code>char *array[1024] = {};
  </code></pre>
  
  <p>Now I would like to add an item to the array and would also access the items by numbers</p>
  
  <p>For example:
  <code>array[0]</code> would be the first item
  <code>array[1]</code> would be the second
  <code>array[2]</code> would be the third item</p>
  
  <p>But also I would like to know how many items are in the array so I could use something like</p>
  
  <pre><code>for(int i = 0; i &lt;= totalitemsinarray; i++) {
      print(array[i]);
  }
  </code></pre>