Tellg
Tellg is a function in the input stream family (std::basic_istream and its derived types, such as std::ifstream and std::istringstream) that returns the current position of the get pointer in the associated stream. It yields a value of type std::basic_ios::pos_type (typically std::streampos) and is a const member function.
Return value semantics: On success, tellg provides the position indicator for the input sequence. If an error
Usage notes: tellg is commonly used to inspect how much data has been read, to compute sizes
Error handling: If the stream is in a failed or bad state, tellg may return pos_type(-1). If
See also: seekg, tellp, and the general behavior of std::istream position handling.