title: C++: Read individual lines from text file, sort words alphabetically
body: <p>I've created a text file with 3 lines filled with random words. I want to :</p>
  
  <ul>
  <li>Read each line in the file individually.</li>
  <li>Sort the words in each line alphabetically</li>
  <li>Output the sorted line to console.</li>
  </ul>
  
  <p>This is what I've come up with so far [runnable]: <a href="https://gist.github.com/anonymous/6211515" rel="nofollow">https://gist.github.com/anonymous/6211515</a></p>
  
  <p>It reads the lines and puts them inside a vector, sorts that vector and then prints the resulting vector to console. But I'm just sorting the lines, I'm not sorting the actual words. I'm inputting the entire line as a string, which is causing my problems. I'm very new to C++ programming and I'm not sure what I should do to be able to sort the actual words, not the lines.</p>
  
  <p>This is not homework, it's just a problem that was suggested to me that I solve in preparation for an upcoming exam. It is of paramount importance that the solution be as simple as possible as this exam will be done with pen and paper.</p>