#2 20.04.06 17:49
Re: Построчное чтение файла в С++
Всё нашёл. Если кого интересует то так:
#include <fstream>
using namespace std;
int main()
{
int n = 0;
ifstream is( "test.txt" );
string sbuf;
while (!is.eof()) {
getline( is, sbuf, '\n' );
n++;
cout << n << ": '" << sbuf << "'" << endl;
}
return 0;
}
Offline

