I havent programmed much for dos lately and
I never got much into the cin, cout stuff.
Is there an advantage other than the syntax
and saving perhaps a few keystrokes on code
generation. Or is the cout more efficient on
my cpu than printf.
I don't think there's much, if any, efficiency difference. The main upside to cin and cout is that they're type-safe and extensible. That is, with printf, if you try to print a character with "%s", you'll get strange results, and there's no way to define a format specifier for types you've created. C++-style streams get around both of those problems; a char will print as a char unless you explicitly tell it to print as something else. You can easily define operators to work with C++ streams and any type you define.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.