What's the correct way to read a text file in C++?
<p>I need to make a program in C++ that must read and write text files line by line with an specific format, but the problem is that in my PC I work in Windows, and in College they have Linux and I am having problems because of line endings are different in these OS.</p>

<p>I am new to C++ and don't know could I make my program able read the files no matter if they were written in Linux or Windows. Can anybody give me some hints? thanks!</p>

<p>The input is like this:</p>

<pre><code>James White 34 45.5 10 black
Miguel Chavez 29 48.7 9 red
David McGuire 31 45.8 10 blue
</code></pre>

<p>Each line being a record of a struct of 6 variables.</p>
