Working with txt file

I'm supposed to make a program in which I print the content of a txt file in the console. And I already have the algorithm to print out all of it properly.

But now, I want to print just a part. I mean, from a given word, I start printing out everything I find to the console till the algorithm finds another word, which is supposed to stop the loop.

I've already tried, with different thing, but nothing works :(
Last edited on
just go through the file using the stream operator, and compare that word to the one that you are looking for, then make a bool to tell if you are going to print it or not, so when it is equal to the one you are looking for, you can toggle that bool, or if you only want one section, if the bool == 0, make it equal to 1, if it is equal to 1, exit loop.
Thanks man!
Topic archived. No new replies allowed.