например: file.txt содержит:
Код: Выделить всё
314
159
265
123
456
Код: Выделить всё
vector ifstream_lines(ifstream& fs) {
vector out;
int temp;
getline(fs,temp);
while (!fs.eof()) {
out.push_back(temp);
getline(fs,temp);
}
fs.seekg(0,ios::beg);
fs.clear();
return out;
}
Код: Выделить всё
error C2784: 'std::basic_istream &std::getline
(std::basic_istream &,std::basic_string &)' :
could not deduce template argument for 'std::basic_istream &' from 'std::ifstream'
Спасибо!
Подробнее здесь: https://stackoverflow.com/questions/167 ... r-of-lines
Мобильная версия