basic_istream& ignore (streamsize n = 1, int_type delim = traits_type::eof());
true
)來訪問輸入序列。然後(如果 good),它會像呼叫其成員函式 sbumpc 或 sgetc 一樣,從其關聯的流緩衝區物件中提取字元,最後銷燬 sentry 物件後返回。numeric_limits<streamsize>::max()
,則沒有限制:將盡可能多地提取字元,直到找到 delim(或檔案尾)。traits_type::eof()
),則沒有字元會與其比較相等,因此將精確丟棄 n 個字元(除非該函式失敗或遇到檔案尾)。*this
的 basic_istream 物件。flag | error |
---|---|
eofbit | 函式停止提取字元,因為輸入序列沒有更多可用字元(已到達 檔案末尾)。 |
failbit | 構造 sentry 失敗(例如,當呼叫前的 *流狀態* 不是 good 時)。 |
badbit | 流錯誤(例如,當此函式捕獲由內部操作丟擲的異常時)。 當此標誌被設定時,流的完整性可能已受到影響。 |
|
|
Please, enter your first name followed by your surname: John Smith Your initials are JS |