How to find the current line position of file pointer in C?

En_t8 picture En_t8 · Mar 28, 2010 · Viewed 40.8k times · Source

How can I get the current line position of the file pointer?

Answer

codaddict picture codaddict · Mar 28, 2010

There is no function that gives you current line. But you can use ftell function to get the offset in terms of number of char from the start of the file.