if (input_stream) // if the file object was successfully created { int line = 0; // line counter array.push_back(vector<char>()); // add first empty line vector
char ch;
// get characters from the stream until EOF is reached while (input_stream.get(ch)) { array[line].push_back(ch); // add character to the end of the line vector
if (ch == '\n') // if newline encountered { ++line; // increase line counter array.push_back(vector<char>()); // add next empty line vector } } }
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment