On Wed, 24 Sep 2003 20:54:46 +0930, "Ying Yang" <Yi******@hotmail.com>
wrote:
Hi,
Whats the difference between printf and cout? They both seem to do the same
thing.
printf << "Hello"; //error
cout("%s", "Hello"); //error
In other words, they have completely different syntax. C++ has both, C
only has printf.
In high level terms, the main differences are type safety (cstdio
doesn't have it), performance (most iostreams implementations are
slower than the cstdio ones) and extensibility (iostreams allows
custom output targets and seamless output of user defined types).
Tom