title: How to get the line number from a file in C++?
body: <p>What would be the best way to get the line number of the current line in a file that I have opened with a <code>ifstream</code>? So I am reading in the data and I need to store the line number that it is on so that I can display it later if the data doesn't match the specifications.</p>