名前空間
変種
操作

std::basic_istream::ignore

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

 
 
入力/出力ライブラリ
I / Oのマニピュレータ
CスタイルのI / O
バッファ
Original:
Buffers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_streambuf
basic_filebuf
basic_stringbuf
strstreambuf(廃止予定)
ストリーム
Original:
Streams
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
抽象化
Original:
Abstractions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ios_base
basic_ios
basic_istream
basic_ostream
basic_iostream
ファイルI / O
Original:
File I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ifstream
basic_ofstream
basic_fstream
文字列I / O
Original:
String I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_istringstream
basic_ostringstream
basic_stringstream
アレイのI / O
Original:
Array I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
istrstream(廃止予定)
ostrstream(廃止予定)
strstream(廃止予定)
タイプ
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
streamoff
streamsize
fpos
エラーカテゴリインターフェース
Original:
Error category interface
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
iostream_category(C++11)
io_errc(C++11)
 
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.
cin
wcin
メンバ関数
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.
basic_istream::basic_istream
basic_istream::~basic_istream
basic_istream::operator=(C++11)
書式付き入力
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.
basic_istream::operator>>
書式なし入力
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::get
basic_istream::peek
basic_istream::unget
basic_istream::putback
basic_istream::getline
basic_istream::ignore
basic_istream::read
basic_istream::readsome
basic_istream::gcount
ポジショニング
Original:
Positioning
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_istream::tellg
basic_istream::seekg
その他
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_istream::sync
basic_istream::swap(C++11)
メンバークラス
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.
basic_istream::sentry
非メンバ関数
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.
operator>>(std::basic_istream)
 
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';
    }
}

Output:

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]