title: terminate called after throwing an instance of 'std::invalid_argument'
body: <p>When I try to run this program I get this error and the program is terminated. The compiler detects no errors.. Any insight would be greatly appreciated.</p>
  
  <p>terminate called after throwing an instance of 'std::invalid_argument'
    what(): Argument value out of range</p>
  
  <p>This application has requested the Runtime to terminate it in an unusual way.
  Please contact the application's support team for more information.</p>
  
  <p><a href="http://pastebin.com/ezHaFuQw" rel="nofollow">http://pastebin.com/ezHaFuQw</a></p>
  
  <p>The pastebin link will show the code I am using, and I just prefer to use paste bin because I personally find it a bit neater and easier to read. Especially for code longer than 100 lines!</p>