title: How to search for certain strings line by line for keywords
body: <p>I have a list of games with their categories in a text file as follows</p>
  
  <pre><code>MMO League Of Legends 
  MMO World Of Warcraft 
  Strategy Civilization 
  Strategy Hearthstone 
  Arcade Street Fighter 
  Arcade PacMan 
  AR Beat Saber 
  AR Superhot 
  </code></pre>
  
  <p>I need to search for each of the categories and whenever it finds a certain category to make an object of that category, for example</p>
  
  <pre><code>if (type == "MMO") game = new MMO(name, description);
  </code></pre>
  
  <p>How do I implement that search(line by line) so it uses everything after the category as the name. In other words I want it to save the whole name in the object not just the first word. </p>
  
  <p>Thanks for the help!</p>
  
  <p>This is my main fuction</p>
  
  <pre><code>int main()
  {
  
  ifstream inFile;
  //Open the file
  inFile.open("Games.txt");
  //Check that file was opened successfully
  if (!inFile) {
      cout &lt;&lt; "Unable to open file";
      exit(1); 
  }
  
  
  
  //Vector to store items
  vector &lt;Game*&gt; games;
  
  //All the items will be sorted using the Standard Library Sort() function.
  void sort();
  
  
  inFile.close(); 
  </code></pre>
  
  <p>}</p>