Namensräume
Varianten
Aktionen

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>

Aus cppreference.com
< cpp‎ | io‎ | basic istream

 
 
Input / Output-Bibliothek
I / O-Manipulatoren
C-style I / O
Puffern
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(veraltet)
Streams
Original:
Streams
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Abstraktionen
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
Datei-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
String 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
Array 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(veraltet)
ostrstream(veraltet)
strstream(veraltet)
Types
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
Fehler Kategorie Schnittstelle
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
Globale Objekte
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
Member-Funktionen
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)
Formatierte Eingabe
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>>
Unformatierte Eingabe
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
Positionierung
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
Verschiedenes
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)
Mitglied Klassen
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
Non-Member-Funktionen
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) (seit C++11)
Führt Zeicheneingabe Operationen .
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)
Extrahiert einen Charakter und speichert sie in 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)
Extrahiert aufeinanderfolgenden Zeichen und speichert sie an aufeinanderfolgenden Stellen einer Zeichengruppe, deren erstes Element ist, um durch s hingewiesen. Die Extraktion wird beendet, wenn eine der folgenden Bedingungen erfüllt sind:
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.
  • ein Whitespace-Zeichen (wie von der ctype<CharT> Facette bestimmt) gefunden wird. Das Leerzeichen ist nicht extrahiert .
    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 Zeichen extrahiert werden
    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.
In beiden Fällen wird eine zusätzliche Nullzeichen Wert CharT() am Ende der Ausgabe gespeichert .
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)
Ruft die entsprechende Eingabe-Operator, da eine rvalue Verweis auf ein Input-Stream-Objekt (entspricht 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.

Inhaltsverzeichnis

[Bearbeiten] Notes

Die (1-2)-Versionen des Betreibers verhalten, als formatierte Eingabe-Funktionen. Das heißt, konstruieren sie eine sentry Objekt am Anfang, dass spült die tie () 'd-Puffer, wenn nötig, Schecks für Fehler, und Extrakte und verwirft alle führenden Leerzeichen, sofern der ios_base :: skipws Flag gelöscht wurde. Der Eingang wird versucht nur, wenn die sentry Objekt true zurück .
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.

[Bearbeiten] Parameter

st -
Eingabestrom, um die Daten zu extrahieren
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 -
Verweis auf ein Schriftzeichen, um das extrahierte Zeichen zu speichern
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 -
Zeiger auf eine Zeichenkette, um die extrahierten Zeichen zu speichern
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.

[Bearbeiten] Rückgabewert

st

[Bearbeiten] Beispiel

#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

[Bearbeiten] Siehe auch

Extrakte formatierte Daten
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.

(öffentliche Elementfunktion) [edit]