Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 17 additions & 18 deletions docs/standard-library/iostreams-conventions.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
---
description: "Learn more about: iostreams Conventions"
title: "iostreams Conventions"
ms.date: "11/04/2016"
description: "Learn more about: iostreams Conventions"
ms.date: 11/04/2016
helpviewer_keywords: ["iostream header", "C++ Standard Library, iostreams"]
ms.assetid: 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>](../standard-library/fstream.md)\
[\<iomanip>](../standard-library/iomanip.md)\
[\<ios>](../standard-library/ios.md)\
[\<iosfwd>](../standard-library/iosfwd.md)\
[\<iostream>](../standard-library/iostream.md)\
[\<istream>](../standard-library/istream.md)\
[\<ostream>](../standard-library/ostream.md)\
[\<sstream>](../standard-library/sstream.md)\
[\<streambuf>](../standard-library/streambuf.md)\
[\<strstream>](../standard-library/strstream.md)
[`<fstream>`](fstream.md)\
[`<iomanip>`](iomanip.md)\
[`<ios>`](ios.md)\
[`<iosfwd>`](iosfwd.md)\
[`<iostream>`](iostream.md)\
[`<istream>`](istream.md)\
[`<ostream>`](ostream.md)\
[`<sstream>`](sstream.md)\
[`<streambuf>`](streambuf.md)\
[`<strstream>`](strstream.md)

The simplest use of iostreams requires only that you include the header [\<iostream>](../standard-library/iostream.md). You can then extract values from [cin](../standard-library/iostream.md#cin) or [wcin](../standard-library/iostream.md#wcin) to read the standard input. The rules for doing so are outlined in the description of the class [basic_istream Class](../standard-library/basic-istream-class.md). You can also insert values to [cout](../standard-library/iostream.md#cout) or [wcout](../standard-library/iostream.md#wcout) to write the standard output. The rules for doing so are outlined in the description of the class [basic_ostream Class](../standard-library/basic-ostream-class.md). Format control common to both extractors and insertors is managed by the class [basic_ios Class](../standard-library/basic-ios-class.md). Manipulating this format information in the guise of extracting and inserting objects is the province of several manipulators.
The simplest use of iostreams requires only that you include the header [`<iostream>`](iostream.md). You can then extract values from [`cin`](iostream.md#cin) or [`wcin`](iostream.md#wcin) to read the standard input. The rules for doing so are outlined in the description of the [`basic_istream` class](basic-istream-class.md). You can also insert values to [`cout`](iostream.md#cout) or [`wcout`](iostream.md#wcout) to write the standard output. The rules for doing so are outlined in the description of the [`basic_ostream` class](basic-ostream-class.md). Format control common to both extractors and insertors is managed by the [`basic_ios` class](basic-ios-class.md). 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>](../standard-library/fstream.md). To convert between iostreams and objects of class [basic_string Class](../standard-library/basic-string-class.md), use the classes declared in [\<sstream>](../standard-library/sstream.md). To do the same with C strings, use the classes declared in [\<strstream>](../standard-library/strstream.md).
You can perform the same iostreams operations on files that you open by name, using the classes declared in [`<fstream>`](fstream.md). To convert between iostreams and objects of [`basic_string` class](basic-string-class.md), use the classes declared in [`<sstream>`](sstream.md). To do the same with C strings, use the classes declared in [`<strstream>`](strstream.md).

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](../standard-library/cpp-standard-library-overview.md)\
[iostream Programming](../standard-library/iostream-programming.md)\
[Thread Safety in the C++ Standard Library](../standard-library/thread-safety-in-the-cpp-standard-library.md)
[C++ Standard Library Overview](cpp-standard-library-overview.md)\
[`iostream` Programming](iostream-programming.md)\
[Thread Safety in the C++ Standard Library](thread-safety-in-the-cpp-standard-library.md)