hi Everyone,

I'm working with a Text file. Somewhere in my code a function returns the current position of the file pointer. But i want it to go to the next line or 2 lines after to do a string search there. Anybody knows how i can do that?

Bests,

Recommended Answers

All 3 Replies

Member Avatar for iamthwee

Store all the lines into a vector.

To point to a line below just do:-

current line + 1

Thanks for your quick response. :)

hi Everyone,

I'm working with a Text file. Somewhere in my code a function returns the current position of the file pointer. But i want it to go to the next line or 2 lines after to do a string search there. Anybody knows how i can do that?

Bests,

If you want the file pointer to goto the next line, then just use the getline(...) funtion
to read in the current line as a dummy. And the file pointer will proceed to the beginning
of the next line.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.