View Poll Results: Which is is better

Voters
57. You may not vote on this poll
  • cout

    26 45.61%
  • printf()

    24 42.11%
  • Either

    7 12.28%
  • Neither

    0 0%

Which one will you prefer: cout or printf

This is a discussion on Which one will you prefer: cout or printf within the A Brief History of Cprogramming.com forums, part of the Community Boards category; yes, i would hate having to DIY formatted output [redirection as well, thank the lord for vsprintf...]......

  1. #31
    Linguistic Engineer... doubleanti's Avatar
    Join Date
    Aug 2001
    Location
    CA
    Posts
    2,459
    yes, i would hate having to DIY formatted output [redirection as well, thank the lord for vsprintf...]...
    hasafraggin shizigishin oppashigger...

  2. #32
    Registered User
    Join Date
    Oct 2001
    Posts
    375
    According to my compiler and profiler, cout is on average 5.75 milliseconds faster than printf. So much for that argument...
    Hmm, printf() benches faster than cout on mine. (mingw32) I think the moral to this story is, that nobody really cares what you use as long as you are comfortable using it.
    Allegro precompiled Installer for Dev-C++, MSVC, and Borland: http://galileo.spaceports.com/~springs/

  3. #33
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,493
    i prefer cout for its simplicity, but its only there when im in c++.

  4. #34
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    cout has quite a bit of overhead that printf doesn't have. And needless to say cout adds quite a bit of size to a file. I actually tend to use both a lot. I go with printf. In terms of ease I'd say that it is an undoubted tie. When it comes to speed, like I said cout has quite a bit of overhead. I found myself using sprintf more than both since I program windows most of the time.

  5. #35
    Registered User dirkduck's Avatar
    Join Date
    Aug 2001
    Posts
    428
    cout, was raised with it .

  6. #36
    Registered User Credo's Avatar
    Join Date
    Feb 2002
    Posts
    3

    Speed!...?

    I don't really have a favorite...they both get the job done. Unless your going to print and entire novel to the screen, speeds not much of an issue. If I had to choose one over the other I'd go with cout because its a little easier to use.

Page 3 of 3 FirstFirst 123
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 03-05-2009, 10:25 AM
  2. Need Help with a Bowling Score Program
    By oobootsy1 in forum C++ Programming
    Replies: 6
    Last Post: 11-01-2005, 10:04 AM
  3. Double to Int conversion warning
    By wiznant in forum C Programming
    Replies: 15
    Last Post: 09-19-2005, 10:25 PM
  4. Replies: 4
    Last Post: 04-01-2003, 12:49 AM
  5. difference between cout and printf
    By Shadow12345 in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2002, 10:27 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21