다음을 통해 공유


입력/출력 스트림

basic_iostream, which is defined in the header file <istream>, is the class template for objects that handle both input and output character-based I/O streams.

There are two typedefs that define character-specific specializations of basic_iostream and can help make code easier to read: iostream (not to be confused with the header file <iostream>) is an I/O stream that is based on basic_iostream<char>; wiostream is an I/O stream that is based on basic_iostream<wchar_t>.

자세한 내용은 basic_iostream 클래스, iostreamwiostream를 참조하십시오.

Deriving from basic_iostream is the class template basic_fstream, which is used to stream character data to and from files.

There also are typedefs that provide character-specific specializations of basic_fstream. They are fstream, which is a file I/O stream that is based on char, and wfstream, which is a file I/O stream that is based on wchar_t. 자세한 내용은 basic_fstream 클래스, fstreamwfstream를 참조하십시오. Using these typedefs requires the inclusion of the header file <fstream>.

참고

When a basic_fstream object is used to perform file I/O, although the underlying buffer contains separately designated positions for reading and writing, the current input and current output positions are tied together, and therefore, reading some data moves the output position.

The class template basic_stringstream and its common specialization, stringstream, are often used to work with I/O stream objects to insert and extract character data. 자세한 내용은 basic_stringstream 클래스을 참조하십시오.

참고 항목

참조

stringstream

basic_stringstream 클래스

<sstream>

iostream 프로그래밍

기타 리소스

C++ 표준 라이브러리 참조