Friday, December 3, 2010

IO Manipulators

IO Manipulators with the following declaration: ios_base& xxx(ios_base&) are used in statements like: std::cout << std::xxx; (i.e. without parentheses) or else they will not compile.

For example:
    cout << hex << 15 << endl;
compiles, but the following doesn't compile:
    cout << hex() << 15 << endl;

No comments:

Post a Comment