title: how to add an element to an array in c++?
body: <p>How would I add an element to an array, assuming that I have enough space? My code looks something like this:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  int main(){
      ofstream out("hi.out");
      ifstream in("hi.in");
      string currentLine;
      string values[135];/*Enough for worst case scenario*/
      if (out.is_open &amp;&amp; in.isopen()){
          while (in &gt;&gt; currentLine){
              /*Add currentLine to values*/
          }
          /*Do stuff with values and write to hi.out*/
      }
      out.close()
      in.close()
      return 0;
  }
  </code></pre>