Position File Pointer to newline immediately on some condition

U

utab

Hi

Is there way to go to the start character of the the proceeding line
while reading from a file. (Sth like working '\n' but immediately will
take me one line down)

Lets say; my file is

abcdefghkl
123 23 43 54
12 3 34 56 77
....
....
....
For example when I am reading a specific line I would like to go to the
start of the newline for some reason.

Thx.
 
T

TB

utab skrev:
Hi

Is there way to go to the start character of the the proceeding line
while reading from a file. (Sth like working '\n' but immediately will
take me one line down)

Lets say; my file is

abcdefghkl
123 23 43 54
12 3 34 56 77
...
...
...
For example when I am reading a specific line I would like to go to the
start of the newline for some reason.

Thx.

std::ifstream in(...);

in.ignore(std::numeric_limits<int>::max(),'\n');
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,681
Members
48,796
Latest member
Greg L.

Latest Threads

Top