名前空間
変種
操作

std::basic_istream::ignore

提供: cppreference.com
< cpp‎ | io‎ | basic istream

 
 
 
std::basic_istream
グローバルオブジェクト
Original:
Global objects
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
メンバ関数
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
書式付き入力
Original:
Formatted input
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
書式なし入力
Original:
Unformatted input
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_istream::ignore
ポジショニング
Original:
Positioning
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
その他
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
メンバークラス
Original:
Member classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
非メンバ関数
Original:
Non-member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
 
basic_istream& ignore( std::streamsize count = 1, int_type delim = Traits::eof() );
delim含むまで、入力ストリームからの抽出物を破棄文字.
Original:
Extracts and discards characters from the input stream until and including delim.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
UnformattedInputFunctionとして動作します。監視オブジェクトを構築し、確認した後、ストリームから文字を抽出し、次のいずれかの条件が発生するまで、それらを廃棄します
Original:
Behaves as UnformattedInputFunction. After constructing and checking the sentry object, extracts characters from the stream and discards them until any one of the following conditions occurs:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
  • count文字がcountstd::numeric_limits<std::streamsize>::max()に等しくなったときにこのテストは特殊なケースでは無効になっています(抽出された
    Original:
    count characters were extracted (this test is disabled in the special case when count equals std::numeric_limits<std::streamsize>::max()
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • ファイルの状態の終わりが入力シーケンスで発生する(そのような場合には、関数がsetstate(eofbit)呼び出します
    Original:
    end of file conditions occurs in the input sequence (in which case the function calls setstate(eofbit)
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • 入力シーケンス内の次の使用可能な文字はcdelimとしてTraits::eq_int_type(Traits::to_int_type(c), delim)によって決定されます。区切り文字を抽出し、(delimTraits::eof()ある場合は、このテストが無効になっている)が廃棄さ
    Original:
    the next available character c in the input sequence is delim as determined by Traits::eq_int_type(Traits::to_int_type(c), delim). The delimiter character is extracted and discarded (this test is disabled if delim is Traits::eof())
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.

目次

[編集] パラメータ

count -
抽出する文字数
Original:
number of characters to extract
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
delim -
での抽出を停止するには、文字を区切る。また、抽出された.
Original:
delimiting character to stop the extraction at. It is also extracted.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] 値を返します

*this

[編集]

#include <iostream>
#include <sstream>
#include <limits>
int main()
{
    std::istringstream input("1\n"
                             "some non-numeric input\n"
                             "2\n");
    for(;;) {
        int n;
        input >> n;
 
        if(input.eof() || input.bad())
            break;
        else if(input.fail()) {
            input.clear(); // unset failbit
            input.ignore(std::numeric_limits<std::streamsize>::max(), '\n'); // skip bad input
        } else
            std::cout << n << '\n';
    }
}

出力:

1
2

[編集] 参照

文字を抽出します
Original:
extracts characters
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]
指定された文字が発見されるまで文字を抽出します
Original:
extracts characters until the given character is found
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]