Can't really help you unless you post a file that you're reading and the code that reads the mentioned file.
Also, ftell() doesn't return the line number. From http://www.cplusplus.com/reference/cstdio/ftell/:
Quote:
For binary streams, this is the number of bytes from the beginning of the file.
For text streams, the numerical value may not be meaningful but can still be used to restore the position to the same position later using fseek (if there are characters put back using ungetc still pending of being read, the behavior is undefined)