title: Storing data from a loop to an array
body: <p>I'm new to c++ and my question is how do I store data from a loop cycle into a array, then print it?
  Do I need to make another loop? if so how do I go about that? also if what I ask is possible, when every time I re-run the compiler will the array above get re-written or erased(hope it does)?</p>
  
  <pre><code>int getcard()
  {
      srand((unsigned)time(0));
  
      int x;
      string mix[10];
      string h;
  
      do
      {
          for (int index = 0; index &lt; 10; index++)
          {
              x = rand() % 18;
              h = master[x];
  
              cout &lt;&lt; h &lt;&lt; endl;
          }
  
          mix[10] = h;
      }
      while (false);
  
      return 0;
  }
  </code></pre>