黄舟2017-04-17 13:15:40
Is this okay? Instead of using an array, use string
#include <iostream>
#include <string>
#include <fstream>
#include <sstream>
using namespace std;
int main()
{
string s;
ifstream input("your file here");
while (getline(input, s))
;
}
PHP中文网2017-04-17 13:15:40
Just use the getline function. For this function, reading from a file is the same as reading from the keyboard. After reading one line, process it and move on to the next line. Just end the reading by judging the stream status