The answer depends a lot on what you want to do. For output which largely uses default formats cout
is indeed preferred because of the type safety and because it's very intuitive.
If you want to heavily format your output though I can only recommend the surprisingly versatile and straight-forward printf
because manipulators in cout are a pain. True: The printf
format syntax, does, let's say, take some getting used to, but it's surely worth it. Just double check the format string, listen to the warnings of your compiler, and use the proper format specifiers e.g. for size_t
and other system dependent data in order to stay portable.
There is also a boost facility for combining streams and printf
style formatting, see https://stackoverflow.com/a/15106194/3150802, but I have never used it. Perhaps somebody can comment on its usability?