skip to content
Ivan's wiki
Site Tools
Search
Tools
Show pagesource
Backlinks
Recent Changes
Media Manager
Sitemap
>
Recent Changes
Media Manager
Sitemap
hpp-ios
This page is read only. You can view the source, but not change it.
# <ios> **[<ios>](https://en.cppreference.com/w/cpp/header/ios)** defines the base classes for input/output streams: `std::ios_base`, `std::basic_ios`. It handles stream state (good, fail, eof), format flags, and locale. Most user code works with derived classes like `std::cin`, `std::cout`, `std::fstream`, and doesn't interact with this header directly. This example sets format flags on cout to display output in hexadecimal and fixed-point notation. ```cpp // compile: g++ -std=c++11 -o iosexample iosexample.cpp // run: ./iosexample // description: check stream state and set format flags #include <ios> #include <iostream> int main() { std::cout.setf(std::ios::hex, std::ios::basefield); std::cout << 42 << "\n"; std::cout.setf(std::ios::fixed | std::ios::showpoint); std::cout << 3.14 << "\n"; return 0; } ```
Page Tools
Show pagesource
Backlinks
Back to top