I have a text data file that spreads over many lines, and i've been using fstream's 'tellg()' to gather position offsets in the file in relation to data read into a buffer from the file (I am reading it in chunks). However when I try to index elements on lines other than the first the index is slightly wrong.
I'm on a windows machine so I know that newline characters in text files are probably classed as two characters: \r\n (0xd 0xa) which would explain why the index is wrong over multiple lines.
extractedSize = fin.rdbuf()->sgetn(...
to read in the data chunks and am relying on its returned value to be the exact amount of bytes extracted from the file. My question is, would this returned value count the newline as having read in 1 character or 2, and is there some easy solution to this im missing. >_<