28 Jul
2008
28 Jul
'08
8:47 p.m.
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