名前空間
変種
操作

operator>><div class="t-tr-text">(のstd :: basic_istream)<div class="t-tr-dropdown"><div><div><div class="t-tr-dropdown-arrow-border"></div><div class="t-tr-dropdown-arrow"></div><div class="t-tr-dropdown-h">Original:</div><div class="t-tr-dropdown-orig">(std::basic_istream)</div><div class="t-tr-dropdown-notes">The text has been machine-translated via [http://translate.google.com Google Translate].<br/> You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.</div></div></div></div></div>

提供: 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)
 
template< class CharT, class Traits >

basic_istream<CharT,Traits>& operator>>( basic_istream<CharT,Traits>& st, CharT& ch );

template< class Traits >
basic_istream<char,Traits>& operator>>( basic_istream<char,Traits>& st, signed char& ch );

template< class Traits >

basic_istream<char,Traits>& operator>>( basic_istream<char,Traits>& st, unsigned char& ch );
(1)
template< class CharT, class Traits>

basic_istream<CharT,Traits>& operator>>( basic_istream<CharT,Traits>& st, CharT* s );

template< class Traits >
basic_istream<char,Traits>& operator>>( basic_istream<char,Traits>& st, signed char* s );

template< class Traits >

basic_istream<char,Traits>& operator>>( basic_istream<char,Traits>& st, unsigned char* s );
(2)
template< class CharT, class Traits, class T >
basic_istream<CharT,Traits>& operator>>( basic_istream<CharT,Traits>&& st, T& value );
(3) (C + + 11以来)
文字入力の操作を実行します.
Original:
Performs character input operations.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
1)
文字を抽出し、chに格納します.
Original:
Extracts a character and stores it to ch.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
連続する文字を格納し、それらの最初の要素sによって指された文字配列の連続した​​位置で抽出されます。次のいずれかの条件が満たされていれば抽出は停止します
Original:
Extracts successive characters and stores them at successive locations of a character array whose first element is pointed to by s. The extraction stops if one of the following conditions are met:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
  • 空白文字(ctype<CharT>ファセットによって決定されるように)発見された。空白文字は抽出されません.
    Original:
    a whitespace character (as determined by the ctype<CharT> facet) is found. The whitespace character is not extracted.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • this->width() - 1文字が抽出されます
    Original:
    this->width() - 1 characters are extracted
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
いずれの場合も、追加のNULL文字値CharT()は、出力の最後に格納され.
Original:
In either case, an additional null character value CharT() is stored at the end of the output.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
3)
入力ストリームオブジェクトへの右辺値参照を指定して、適切な抽出演算子は、(st >> valueに相当)を呼び出し.
Original:
Calls the appropriate extraction operator, given an rvalue reference to an input stream object (equivalent to st >> value).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

目次

[編集] ノート

演算子の(1-2)のバージョンは次のように書式付き入力関数振る舞う。すなわち、彼らは必要に応じてのtie()をフラッシュ 'Dバッファ、エラーをチェックし、抽出液を破棄ios_bas​​eのない限り、すべての先行する空白文字という冒頭sentryオブジェクトを構築:: skipwsフラグがクリアされました。入力はsentryオブジェクトがtrueを返した場合にのみ試行されます.
Original:
The (1-2) versions of the operator behave as formatted input functions. That is, they construct a sentry object at the beginning that flushes the tie()'d buffers if needed, checks for errors, and extracts and discards all leading whitespace characters unless the ios_base::skipws flag was cleared. The input is attempted only if the sentry object returns true.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] パラメータ

st -
入力ストリームからデータを抽出する
Original:
input stream to extract the data from
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ch -
に抽出された文字を格納する文字への参照
Original:
reference to a character to store the extracted character to
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
s -
に抽出された文字列を格納するための文字列へのポインタ
Original:
pointer to a character string to store the extracted characters to
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] 値を返します

st

[編集]

#include <iostream>
#include <iomanip>
#include <sstream>
 
int main()
{
    std::string input = "n greetings";
    std::istringstream stream(input);
    char c;
    const int MAX = 6;
    char cstr[MAX];
 
    stream >> c >> std::setw(MAX) >> cstr;
    std::cout << "c = " << c << '\n'
              << "cstr = " << cstr << '\n';
 
    double f;
    std::istringstream("1.23") >> f; // rvalue stream extraction
    std::cout << "f = " << f << '\n';
}

Output:

c = n
cstr = greet
f = 1.23

[編集] も参照してください

抽出は、データをフォーマットします
Original:
extracts formatted data
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

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