共用方式為


basic_streambuf::pubseekpos

呼叫 seekpos,在衍生類別中覆寫的受保護虛擬函式 (Virtual Function),並重設目前的位置。

pos_type pubseekpos(
   pos_type _Sp,
   ios_base::openmode _Which = ios_base::in | ios_base::out
);

參數

  • _Sp
    要尋找的位置。

  • _Which
    以指標位置指定模式。 預設值為可讓您修改和讀取/寫入位置。

傳回值

新位置或一個無效的資料流位置。 若要判斷資料流位置是否無效,請比較的值和 pos_type(off_type(-1))的傳回值。

備註

成員函式傳回 seekpos(_Sp, _Which)。

需求

標題: <streambuf>

命名空間: std

請參閱

參考

basic_streambuf Class

iostream 程式設計

iostreams 慣例