skip to content
Ivan's wiki
Site Tools
Search
Tools
Show pagesource
Backlinks
Recent Changes
Media Manager
Sitemap
>
Recent Changes
Media Manager
Sitemap
hpp-ostream
This page is read only. You can view the source, but not change it.
# <ostream> **[<ostream>](https://en.cppreference.com/w/cpp/header/ostream)** defines `std::basic_ostream` and `std::ostream`, the base classes for output streams. It provides `operator<<` for formatted output, `put()`, `write()`, and `flush()`. Most code uses `std::cout` or file output streams that inherit from this class. This example writes formatted output to a generic ostream reference and explicitly flushes the stream. ```cpp // compile: g++ -std=c++11 -o ostreamexample ostreamexample.cpp // run: ./ostreamexample // description: write to output stream #include <ostream> #include <iostream> int main() { std::ostream& out = std::cout; out << "hello " << 42 << " " << 3.14 << "\n"; out.flush(); return 0; } ```
Page Tools
Show pagesource
Backlinks
Back to top