The I/O Headers. McGraw-Hill The Complete Reference Fourth Edition
Oglas
Oglas
790
C + + : T h e C o m p l e t e R e f e r e n c e
Template
Class basic_ifstream basic_ofstream basic_fstream
Character-Based
Class ifstream ofstream fstream
Wide-Character-Based
Class wifstream wofstream wfstream basic_istringstream istringstream basic_ostringstream ostringstream basic_stringstream stringstream wistringstream wostringstream wstringstream basic_streambuf basic_filebuf basic_stringbuf streambuf filebuf stringbuf wstreambuf wfilebuf wstringbuf
Since the vast majority of programmers will be using character-based I/O, those are the names used by this chapter. Thus, when referring to the I/O classes, we will simply use their character-based names rather than their internal, template names. For instance, this chapter will use the name ios rather than basic_ios, istream rather than basic_istream, and fstream rather than basic_fstream. Remember, parallel classes exist for widecharacter streams and they work in the same way as those described here.
The I/O Headers
The Standard C++ I/O system relies upon several headers. They are shown here.
Header
<fstream>
<iomanip>
<ios>
<iosfwd>
<iostream>
<istream>
<ostream>
For
File I/O
Parameterized I/O manipulators
Basic I/O support
Forward declarations used by the I/O system
General I/O
Basic input support
Basic output support
Preuzimanje
Oglas