Hi I am writing a program and I used function tellg I thought tellg () returns curent possition of curssor in file but this is not true. Letter I try one simple program
Because the member function "string::length()" returns the number of characters in the string where as the member function "ifstream::tellg()" tells you the current position of the pointer in that stream.
EDIT: These are member functions, meaning the data they return is somehow related to or based on the variable that they are attached to. So in the case of "length()" it was attached to the string "line", anything to do with the ifstream "file" is outside of it's scope.