View Poll Results: the most annoying error

Voters
9. You may not vote on this poll
  • syntax

    5 55.56%
  • precompiled header directive

    1 11.11%
  • undeclared identetive

    1 11.11%
  • multitasking

    2 22.22%

printf and cout

This is a discussion on printf and cout within the C++ Programming forums, part of the General Programming Boards category; is cout more advansed than printf??????...

  1. #1
    Neoseeker's master master2000's Avatar
    Join Date
    Dec 2002
    Posts
    101

    Question printf and cout

    is cout more advansed than printf??????
    missles on metriods

  2. #2
    Refugee face_master's Avatar
    Join Date
    Aug 2001
    Posts
    2,052
    cout == C++
    printf == C

  3. #3
    Registered User abrege's Avatar
    Join Date
    Nov 2002
    Posts
    369
    Since I learned C++ before C I'm accustomed to using cout! But I think with printf you don't need to type as much.
    I am against the teaching of evolution in schools. I am also against widespread
    literacy and the refrigeration of food.

  4. #4
    Neoseeker's master master2000's Avatar
    Join Date
    Dec 2002
    Posts
    101
    this is an example of
    Code:
    printf
    Code:
     
    
    printf("hello world");
    you have to print *****more******than
    Code:
     cout<<
    missles on metriods

  5. #5
    Registered User abrege's Avatar
    Join Date
    Nov 2002
    Posts
    369
    Actually when outputing variables I think printf is quicker with its %v's than cout with its << v's.
    I am against the teaching of evolution in schools. I am also against widespread
    literacy and the refrigeration of food.

  6. #6
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    If you're trying to learn C++, stick to the standard IO streams that C++ uses. You really should go read a book and stop asking trivial questions.

    print( "Here is a number %d.", number);

    cout << "Here is a number " << number << ".";

    The benifit, as it were, of the new C++ streams is that you really don't have to implicitly set the type of all your variables to make them print right. You just stick the variable name in the argument line:

    cout << a_number << a_string << a_float << a_char;

    Whatever one you pick, don't mix and match them in the same program. (IE: don't use both printf and cout in the same program.) It makes your code ugly and is generally considered bad form.

    Quzah.
    Hope is the first step on the road to disappointment.

  7. #7
    Neoseeker's master master2000's Avatar
    Join Date
    Dec 2002
    Posts
    101
    thanks i get the point
    missles on metriods

  8. #8
    moi
    moi is offline
    Registered User moi's Avatar
    Join Date
    Jul 2002
    Posts
    946
    wtf is up with that poll?
    hello, internet!

  9. #9
    Neoseeker's master master2000's Avatar
    Join Date
    Dec 2002
    Posts
    101
    i wanted to make one
    missles on metriods

  10. #10
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Originally posted by moi
    wtf is up with that poll?
    Apparently the same thing that's up with their sig.

    Quzah.
    Hope is the first step on the road to disappointment.

  11. #11
    Neoseeker's master master2000's Avatar
    Join Date
    Dec 2002
    Posts
    101

    huh :confused:

    WHAAAA???????????????????????
    missles on metriods

  12. #12
    Funniest man in this seat minesweeper's Avatar
    Join Date
    Mar 2002
    Posts
    801
    What's multitasking got to do with printf and cout?

  13. #13
    Programming Sex-God Polymorphic OOP's Avatar
    Join Date
    Nov 2002
    Posts
    1,078
    cout is more typesafe than printf

  14. #14
    moi
    moi is offline
    Registered User moi's Avatar
    Join Date
    Jul 2002
    Posts
    946
    Originally posted by Polymorphic OOP
    cout is more typesafe than printf
    get gcc and heed the warning messages.
    hello, internet!

  15. #15
    Just a Member ammar's Avatar
    Join Date
    Jun 2002
    Posts
    953
    Originally posted by abrege
    Actually when outputing variables I think printf is quicker with its %v's than cout with its << v's.
    Although it might me quicker, but I think that the cout is more readable.
    none...

Page 1 of 2 12 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. cout to printf problems
    By hallo007 in forum C++ Programming
    Replies: 9
    Last Post: 09-27-2006, 11:22 AM
  2. how to do printf( "%c", 12 ); via ostream cout ??
    By L.O.K. in forum C++ Programming
    Replies: 9
    Last Post: 01-08-2005, 06:37 PM
  3. (printf VS cout) and (including libraries)
    By \cFallen in forum C++ Programming
    Replies: 3
    Last Post: 01-20-2003, 09:47 PM
  4. printf vs cout
    By RyeDunn in forum C++ Programming
    Replies: 5
    Last Post: 07-09-2002, 05:26 PM
  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