The C Standard Library
The C++ Standard Library
The C++ STL Library
C++ Programming Resources
Selected Reading
The C++ Standard Library
- C++ Library - <valarray>
- C++ Library - <utility>
- C++ Library - <typeinfo>
- C++ Library - <tuple>
- C++ Library - <thread>
- C++ Library - <string>
- C++ Library - <stdexcept>
- C++ Library - <regex>
- C++ Library - <numeric>
- C++ Library - <new>
- C++ Library - <memory>
- C++ Library - <locale>
- C++ Library - <limits>
- C++ Library - <functional>
- C++ Library - <exception>
- C++ Library - <complex>
- C++ Library - <atomic>
- C++ Library - <streambuf>
- C++ Library - <sstream>
- C++ Library - <ostream>
- C++ Library - <istream>
- C++ Library - <iostream>
- C++ Library - <iosfwd>
- C++ Library - <ios>
- C++ Library - <iomanip>
- C++ Library - <fstream>
- C++ Library - Home
The C++ STL Library
- C++ Library - <iterator>
- C++ Library - <algorithm>
- C++ Library - <vector>
- C++ Library - <unordered_set>
- C++ Library - <unordered_map>
- C++ Library - <stack>
- C++ Library - <set>
- C++ Library - <queue>
- C++ Library - <map>
- C++ Library - <list>
- C++ Library - <forward_list>
- C++ Library - <deque>
- C++ Library - <bitset>
- C++ Library - <array>
C++ Programming Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
C++ Library - <ostream>
C++ Library - <ostream>
Introduction
It is an output stream objects can write sequences of characters and represent other kinds of data. Specific members are provided to perform these output operations.
Definition
Below is definition of std::ostream.
typedef basic_ostream<char> ostream;
Parameters
charT − Character type.
traits − Character traits class that defines essential properties of the characters used by stream objects.
Member types
Sr.No. | Member types | Definition |
---|---|---|
1 | Type to indicate event type | |
2 | Event callback function type | |
3 | Base class for stream exceptions | |
4 | Type for stream format flags | |
5 | Initiapze standard stream objects | |
6 | Type for stream state flags | |
7 | Type for stream opening mode flags | |
8 | Type for stream seeking direction flag | |
9 | It is used to prepare stream for input | |
10 | It is used to prepare stream for output |
Pubpc Member Functions
Sr.No. | Member types | Definition |
---|---|---|
1 | Construct object (pubpc member function ) | |
2 | Destruct object (pubpc member function ) |
Pubpc member functions
Sr.No. | Member Functions | Definition |
---|---|---|
1 | It is used to get character count | |
2 | It is used to get characters | |
3 | It is used to get pne | |
4 | It is used to extract and discard characters | |
5 | It is used to peek next character | |
6 | It is used to read block of data | |
7 | It is used to Read data available in buffer | |
8 | It is used to put character back | |
9 | It is used to unget character |
Formatted output
Sr.No. | Output | Definition |
---|---|---|
1 | It is used to extract formatted input |
Unformatted output
Sr.No. | Output | Definition |
---|---|---|
1 | It is used to put character | |
2 | It is used to write block of data |
Positioning
Sr.No. | Position | Definition |
---|---|---|
1 | It is used to get position in output sequence | |
2 | It is used to set position in output sequence |
Synchronization
Sr.No. | Synchronization | Definition |
---|---|---|
1 | It is used to flush output stream buffer |
Protected member functions
Sr.No. | Member Functions | Definition |
---|---|---|
1 | It is used to move assignment | |
2 | It is used to swap internals |
Pubpc member functions inherited from basic_ios
Sr.No. | Member types | Definition |
---|---|---|
1 | It is used to check whether state of stream is good | |
2 | It is used to check whether eofbit is set | |
3 | It is used to check whether either failbit or badbit is set | |
4 | It is used to check whether badbit is set | |
5 | Evaluate stream | |
6 | It is used to get error state flags | |
7 | It is used to set error state flag | |
8 | It is used to set error state flag | |
9 | Get/set fill character | |
10 | It is used to get/set exceptions mask | |
11 | Imbue locale | |
12 | It is used to get/set tied stream | |
13 | It is used to get/set stream buffer | |
14 | Narrow character | |
15 | Widen character |