// io/rdbuf1.cpp #include #include using namespace std; int main() { // Поток для шестнадцатеричного стандартного вывода ostream hexout(cout.rdbuf()); hexout.setf (ios::hex, ios::basefield); hexout.setf (ios::showbase); // Переключение между десятичным и шестнадцатеричным выводом hexout << "hexout: " << 177 << " "; cout << "cout: " << 177 << " "; hexout << "hexout: " << -49 << " "; cout << "cout: " << -49 << " "; hexout << endl; }