Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > C++: printf Vs cout

Reply
Thread Tools

C++: printf Vs cout

 
 
Ying Yang
Guest
Posts: n/a
 
      09-24-2003
Hi,

Whats the difference between printf and cout? They both seem to do the same
thing.


Regards
dsfg


 
Reply With Quote
 
 
 
 
Unforgiven
Guest
Posts: n/a
 
      09-24-2003
Ying Yang wrote:
> Hi,
>
> Whats the difference between printf and cout? They both seem to do
> the same thing.


Please check if this answers your question:
http://www.parashift.com/c++-faq-lit....html#faq-15.1

--
Unforgiven

"Most people make generalisations"
Freek de Jonge
 
Reply With Quote
 
 
 
 
Anthony
Guest
Posts: n/a
 
      09-24-2003
Hi,
There is a whole book written about streams (cout).
Think you'll find your answer there.
http://www.langer.camelot.de/IOStrea...cerpt.htm#Main

If that's not enough, here is a link to a very good c++ book (also available
online)
http://mindview.net/Books/DownloadSites
The second edition of this book contains a chapter about streams.
You will find the printf vs cout here.

Greetingz
Anthony


"Ying Yang" <(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed)...
> Hi,
>
> Whats the difference between printf and cout? They both seem to do the

same
> thing.
>
>
> Regards
> dsfg
>
>



 
Reply With Quote
 
tom_usenet
Guest
Posts: n/a
 
      09-24-2003
On Wed, 24 Sep 2003 20:54:46 +0930, "Ying Yang" <(E-Mail Removed)>
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
 
Reply With Quote
 
Kevin Goodsell
Guest
Posts: n/a
 
      09-24-2003
Anthony wrote:

> Hi,


Please don't top-post. Read section 5 of the FAQ for posting guidelines.

http://www.parashift.com/c++-faq-lit...t.html#faq-5.4

-Kevin
--
My email address is valid, but changes periodically.
To contact me please use the address from a recent posting.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: cout vs std::cout Hendrik Schober C++ 7 10-07-2008 12:02 AM
Re: cout vs std::cout Stefan Ram C++ 7 09-30-2008 01:55 PM
can cout<<""; can cout<<""; contribute ? wangzhihuii@yahoo.com.cn C++ 4 09-15-2005 06:16 PM
std::cout vs cout Pmb C++ 2 06-02-2004 03:27 PM
man cout or info cout abi C++ 2 06-28-2003 06:42 PM



Advertisments