Accesing two different rows simultaneously in C -
suppose have data set arranged in following way
19 10 1 1 12 15 1 1 13 12 4 5 10 5 2 3 ...
and on, @ particular iteration in loop have read 1st , 4th row , in next iteration have access other set of rows,for example
1st iteration: 1st row: 19 10 1 1 4th row: 10 5 2 3
i access data using fscanf() function. how ensure choose 1st , 4th rows or 2 rows matter @ given iteration?
(i have not considered reading 2d array since size of data set 10^8 )
thank you.
as read through data (say, stored in standard file), byte offsets rows looking row delimiters (a newline character). can read out rows based on start , end byte offset c pointer arithmetic on file *
, fseek()
. storing few byte offsets (an 8 byte long
or equivalent, often) cheap.
Comments
Post a Comment