Boost logo

Boost Users :

From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-07-28 16:47:23


AMDG

Gang Ma wrote:
> infile.seekg(linenum,ios::beg);
> <snip>
>
> I would like thread1 read linie 0-4 and thread2 read line 5-9. My
> dummy test file has 10 lines, each line is 1,2, 3...,10 etc.

seekg takes the number of bytes to move the read position.
You can't find the beginning of the nth line of a text file without
reading the file and counting new line characters.

In Christ,
Steven Watanabe


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net