It is used to set position pointer to absolute position and sets the absolute new position pos for the position pointers specified by parameter which.
Following is the declaration for std::stringbuf::seekpos.
streampos seekpos (streampos sp, ios_base::openmode which = ios_base::in | ios_base::out);
pos − New absolute position for the position pointer.
way − It determines which of the position pointers is affected: the get pointer.
It returns pos on success or the function returns streampos(streamoff(-1))on failure.
Basic guarantee − if an exception is thrown, the object is in a valid state.
it modifies the stringbuf object.