i have to open and read a file with c++. I'm doing like this:
#include<iostream>
using namespace std;
int main()
{
ifstream fin ("P01-05 tensione di vapore di riferimento fino 180°C.dat");
if (!fin)
{
cerr << "\nErrore: non si puo aprire il file.\n" << endl;
exit(1);
}
string line;
while (getline(fin,line))
....
but i want to know if there is an alternative way to read a file until the EOF without using a loop like in this case.
Thank you