If FRM can pick up some sponsors and a decent or better 2 nd driver to replace Buescher , this could be a very good move for Landon . <| sep |> This might get moved to rcppquestions soon , but while it ' s here . I reckon this is a pretty good attempt . Just a couple of nitpicks If you haven ' t come across stdstring yet , then you ' re in for a pleasant surprise ! It can make your program a bit simpler In C , don ' t use # define for numeric constants like your LINEWIDTH . It ' s preferable to say const int linewidth 100 or , even better in C 11 constexpr int linewidth 100 It ' s not wrong , but there ' s not need to say f . close at the end the file will automatically be closed in the destructor anyway . Lastly , it looks as if the program will quit if it sees any line beginning with a Q . Instead , it should probably quit if the line contains only a ' Q ' and nothing else .