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; Which one is better? I prefer cout < printf...

  1. #1
    A Banana Yoshi's Avatar
    Join Date
    Oct 2001
    Posts
    857

    Question Which one will you prefer: cout or printf

    Which one is better?
    I prefer cout < printf
    Last edited by Yoshi; 12-05-2001 at 08:45 AM.
    Yoshi

  2. #2
    Disagreeably Disagreeable
    Join Date
    Aug 2001
    Posts
    711
    I have to say cout. I was raised on it...

  3. #3
    Registered User dune911's Avatar
    Join Date
    Sep 2001
    Posts
    140
    i prefer cout
    i can't wait to use it again, learning c at the moment... *sigh*

  4. #4
    Disagreeably Disagreeable
    Join Date
    Aug 2001
    Posts
    711
    >i can't wait to use it again, learning c at the moment... *sigh*<

    C++ is backwards compatible with C, right? If you know C++, then you know C.

    Unless, do you mean you're learning how to write programs entirely in C using no C++?

  5. #5
    Registered User
    Join Date
    Oct 2001
    Posts
    19
    That depends on what you term 'knowing' a language. with C++, for instance, you are freed / shielded from some relatively low-level procedures, such as memory allocation and I/O. Although C also provides some functions for these, there are some things in C that a typical C++ programmer will not need to use - malloc() for instance.

    Peter Kimberley
    peter_kimberley@hotmail.com

  6. #6
    Flash Animator, OF DOOOOM bluehead's Avatar
    Join Date
    Nov 2001
    Posts
    269
    it depends on what you are trying to use......If it is a simple game, i prefer using the putch(''); command, but it only outputs one variable. If your just outputting a message you want the user to know, use cout<<""; command. If you want a message at a sertian spot, use gotoxy(x, y); command and the cprintl(""); ((or whatever it is ). It just depends on what you are doing.
    Code:
    #if _emo
      #define stereo_type_i_dislike
    #endif

  7. #7
    Intranasal Heroin User Xterria's Avatar
    Join Date
    Sep 2001
    Location
    Buffalo, NY
    Posts
    1,035
    Well, you can do c by just using conio and stdio.h, and, instead of #include<stdio.h> its #include "stdio.h"...and you can't use classes. Thats really the only difference.

    <<"command and the cprintl("");"

    its printf() or if your using conio sprintf to copy a string to a variable, and cprintf() not cprintl

  8. #8
    Banned frenchfry164's Avatar
    Join Date
    Oct 2001
    Posts
    1,552
    I like cout myself. You don't need to worry about \'s as much, and it looks neater. Also I think cout runs faster. sprintf() Might be the same, I never used it. I saw it in Andre Lamthe's Game Programming in 21 Days though

  9. #9
    Registered User
    Join Date
    Aug 2001
    Posts
    202
    printf() all the way... you gotta have the formating
    ---------------
    starX
    www.axisoftime.com

  10. #10
    Banned maes's Avatar
    Join Date
    Aug 2001
    Posts
    744
    >> printf() all the way... you gotta have the formating
    same here. or maybe it's because I almost never used cout.

    >>Also I think cout runs faster.
    I think printf() is faster. I vaguely (very very very vaguely) remembered a discusion on the old board. and I think it was Sunlight who wrote a program to test it and printf() was faster.
    (or was it the other way around, oh well)

  11. #11
    Kiss the monkey. CodeMonkey's Avatar
    Join Date
    Sep 2001
    Posts
    907
    Printf: faster
    Printf: Cleaner
    Printf: Flexable
    Cout<< slow
    Cout<< easy
    Cout<< grew up on it.

    Close, but I say Printf.
    "If you tell the truth, you don't have to remember anything"
    -Mark Twain

  12. #12
    A Banana Yoshi's Avatar
    Join Date
    Oct 2001
    Posts
    857
    Now

    printf() == cout << ;

    Yoshi

  13. #13
    Registered User
    Join Date
    Nov 2001
    Posts
    2

    Cool

    Only one thing.

    Cout works also under graphics, (#include <graphics.h>), so quite better than some terrible outtextxy(...); <- parameter must be char* so it is'nt so simple typing some float or etc. in graphics
    without cout (you must use smth. like ftoa(...) to transform it to char* and then use outtextxy(...))

    PS: cin>> also works

  14. #14
    Registered User Camilo's Avatar
    Join Date
    Oct 2001
    Posts
    78
    printf is nicer, it formats the text for you, and I grew up with it.



    Camilo
    no, life is nice, just a girl fooling around, alcohol fixes everything.
    OH, I now have a High School Diploma and need of ron (drink)

  15. #15
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913

    People say penny for your thoughts, but your opinion is your two cents.. What the..

    I've always wondered about the question in bold above... Anyway, back to the subject. I think people who are beginners at programming are going to vote for cout. Most course teach it first, and so they're more used to it. My first reaction when I saw the poll, was printf, because it's used in traditional function notation (as opposed to the overloaded extraction and insertion operatros used in cout), and I think simple things work better... but then of course I realized how they get the little extraction operators to work, so now I have no opinion, and I'm asking that same question..... What do you prefer? cout or printf();?

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

Similar Threads

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

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