Reading a 2nd line of a file
Hey! Im trying to figure out how to read from a file, but not JUST the first line. I already know how to read from the first line:
|
getline(txtfile, target_string);
|
but that ONLY coppies the first line. How would I do more than the first line? Thanks alot guys! :)
If you repeat the input operation, you can reach other lines.
Trywhile(std::getline(file, my_string) ) std::cout << my_string << '\n';
Topic archived. No new replies allowed.