The idiomatic way to read lines from a stream is thus: { std:: ifstream filein("Hey.txt"); for ...
stackoverflow.com