Reading from specified lines in file in C

i want to read text between two indices in the file using file i/o operations in c++. HOw can i do it? for example, here is the text file:

1:
..
..
2:
..
..
3:
..
..
4:

in this text file i need to print only the lines between 2: and 3:. How could this be done?
I guess that you will have to read the file until you get to the line with text "2:" and then print out the lines until the line "3:".
I doubt there is a simpler way.
Topic archived. No new replies allowed.