title: How would you add chars to an array dynamically? Without the array being predefined?
body: <p>If I want to add chars to char array, I must do it like this:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main() {
      int i;
      char characters[7] = "0000000";
      for (i = 0; i &lt; 7; i++) {
          characters[i] = (char)('a' + i);
          if (i &gt; 2) {
              break;
          }
      }
  
      for (i = 0; i &lt; 7; i++) {
          printf("%c\n", characters[i]);
      }
      return 0;
  }
  </code></pre>
  
  <p>To prevent from printing any weird characters, I must initialize the array, but it isn't flexible. How can I add characters to a char array dynamically? Just like you would in Python:</p>
  
  <pre><code>characters = []
  characters.append(1)
  ...
  </code></pre>