This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: printf VS cout
- From: Ian Lance Taylor <iant at google dot com>
- To: Detlev Casanova <detlev dot casanova at gmail dot com>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: 09 Jun 2007 09:20:45 -0700
- Subject: Re: printf VS cout
- References: <200706091314.35232.detlev.casanova@gmail.com>
Detlev Casanova <detlev.casanova@gmail.com> writes:
> They say that with C++, the printf() function must not be used at all, that
> cout is to be used. they say that printf() is only for C programming.
>
> On a personnal project, I use printf() a lot even if it is in C++.
>
> So, is it true ? Do I have to use cout instead of printf in C++ code ?
This question is more appropriate for gcc-help than for libstdc++,
which is a developer's list. Please take any followups to gcc-help.
Thanks.
printf works fine in C++ code. Whether to use it or not is entirely a
matter of programming style.
Ian