ios and ios_base class for stream formatting
问题 I found there is two ways to setf()/unsetf() for the iostream, that is (1) ios and (2) ios_base. #include <iostream> using namespace std; int main() { cout.width(5); cout << 123 << endl; cout.setf(ios::adjustfield); // (1) using ios:: cout << 123 << endl; cout.width(5); cout << 456 << endl; cout.setf(ios_base::adjustfield); // (2) using ios_base:: cout << 456 << endl; return 0; } What's the difference of them when I would like to change the format of the ostream; Which do you use normally in