Although not every tt(istream) object supports i(repositioning), some do. This
means that it is possible to read the same section of a stream
repeatedly. Repositioning is frequently used in emi(database applications)
where it must be possible to access the information in the database randomly.

The current position can be obtained and modified using the following members:
    itemization(
    ithtq(tellg)(ios::pos_type tellg())
        (hi(pos_type)the stream's current (absolute) position where the
stream's next read-operation will take place is returned.)
    ithtq(seekg)
        (istream &seekg(ios::off_type step, ios::seekdir org))
        (modifies a stream's actual position. The function expects an
ti(off_type) tt(step) representing the number of bytes the current stream
position is moved with respect to tt(org). The tt(step) value may be negative,
zero or positive.

    The origin of the step, tt(org) is a value in the
hi(seekdir)tt(ios::seekdir) enumeration. Its values are:
        itemization(
        ithtq(beg)(ios::beg)
            (the stepsize is computed relative to the beginning of the
stream. This value is used by default.
            )
        ithtq(cur)(ios::cur)
            (the stepsize is computed relative to the current position of the
stream (as returned by tt(tellp)).
            )
        ithtq(end)(ios::end)
            (the stepsize is interpreted relative to the current end position
of the stream.)
    )
    It is OK to hi(seek beyond file boundaries) seek beyond the last file
position.  Seeking before tt(ios::beg) raises the hi(failbit)tt(ios::failbit)
flag.

    Calling tt(seekg) clears the tt(istream's ios::failbit), but not its
tt(ios::badbit) or tt(ios::badbit). To ensure that the stream's state is reset
to `good' its member tt(clear) should be called.

To illustrate: in the following example tt(cin's ios::eofbit) is
set. Following tt(seekg) that bit is cleared, but its tt(ios::goodbit) stil
isn't set. Since its tt(goodbit) isn't set, extraction fails following
tt(seekg):
        verb(    int main()                  // in 'src.cc'
    {
        cin.setstate(ios::eofbit | ios::failbit);
        cerr << cin.good() << ' ' << cin.eof() << '\n';
    
        cin.seekg(0);
        cerr << cin.good() << ' ' << cin.eof() << '\n' <<
                (cin.get() == EOF ? "failed" : "OK") << '\n';
    
        cin.clear();
        cerr << cin.good() << ' ' << cin.eof() << '\n' <<
                (cin.get() == EOF ? "failed" : "OK") << '\n';
    }
    outputs when called as 'a.out < src.cc':
        0 1
        0 0
        failed
        1 0
        OK)
        )
    )
