title: (C++) Counting inversions in arrays from text file, one array per line?
body: <p>I need to count the number of inversions in arrays stored in a text file, such as:</p>
  
  <pre><code>1 4 5 3 2
  2 1 4 3
  6 2 4 1 3 5
  </code></pre>
  
  <p>I have written two functions to count the inversions, but they take arrays as arguments, like this: </p>
  
  <pre><code>int merge_sort(int array[], int inferior_limit, int superior_limit) 
  </code></pre>
  
  <p>My question now is how to read the text file, one line at a time, and store each line into an array to count the inversions. I thought of using a 2D array, but the number of columns varies in each line. I have also considered using <code>getline</code>, as in: </p>
  
  <pre><code>    while(std::getline(inFile,numbers))
  </code></pre>
  
  <p>However, I don't know what to follow it with so that it doesn't read all the numbers. Any help would be greatly appreciated. </p>