wiki:hpp-ios
<ios>
<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.
Example
This example sets format flags on cout to display output in hexadecimal and fixed-point notation.
// 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; }
wiki/hpp-ios.md · Last modified: by 127.0.0.1
