I have to read lines from an extern text file and need the 1. character of some lines.
Is there a function, which can tell me, in which line the pointer is and an other function, which can set the pointer to the begin of line x?
I have to jump to lines before and after the current position.
There is no such function i think. You will have to implement this functionality yourself using
getline()probably, or scan the file for endline characters (\n) one character at a time and store just the one character after this one.You may find a vector (
vector<size_t>probably) helpful to store the offsets of line starts, this way you might be able to jump in the file in a line-based way. But haven’t tried this, so it may not work.