Skip to content

Latest commit

 

History

History
33 lines (26 loc) · 2.61 KB

iostreams-conventions.md

File metadata and controls

33 lines (26 loc) · 2.61 KB
description title ms.date helpviewer_keywords ms.assetid
Learn more about: iostreams Conventions
iostreams Conventions
11/04/2016
iostream header
C++ Standard Library, iostreams
9fe5ded0-37a1-48d1-9671-c81ffc4760ad

iostreams Conventions

The iostreams headers support conversions between text and encoded forms, and input and output to external files:

<fstream>
<iomanip>
<ios>
<iosfwd>
<iostream>
<istream>
<ostream>
<sstream>
<streambuf>
<strstream>

The simplest use of iostreams requires only that you include the header <iostream>. You can then extract values from cin or wcin to read the standard input. The rules for doing so are outlined in the description of the class basic_istream Class. You can also insert values to cout or wcout to write the standard output. The rules for doing so are outlined in the description of the class basic_ostream Class. Format control common to both extractors and insertors is managed by the class basic_ios Class. Manipulating this format information in the guise of extracting and inserting objects is the province of several manipulators.

You can perform the same iostreams operations on files that you open by name, using the classes declared in <fstream>. To convert between iostreams and objects of class basic_string Class, use the classes declared in <sstream>. To do the same with C strings, use the classes declared in <strstream>.

The remaining headers provide support services, typically of direct interest to only the most advanced users of the iostreams classes.

See also

C++ Standard Library Overview
iostream Programming
Thread Safety in the C++ Standard Library