470,833 Members | 1,190 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,833 developers. It's quick & easy.

Position File Pointer to newline immediately on some condition

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.

Feb 26 '06 #1
1 1992
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');

--
TB @ SWEDEN
Feb 26 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Peter Abel | last post: by
5 posts views Thread by Magix | last post: by
2 posts views Thread by Bob Cummings | last post: by
7 posts views Thread by Morten Wennevik | last post: by
2 posts views Thread by Senthil | last post: by
3 posts views Thread by utab | last post: by
6 posts views Thread by tomtown.net | last post: by
6 posts views Thread by Mahendra | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.