printf manual

Discussion in 'Programming' started by proxymaster, Sep 1, 2007.

  1. #1
    I know how to use printf but where can I find a manual with all the arguments to stick into the printf() function? the language is C (I'm not sure if any arguments are specific to C?? )
     
    proxymaster, Sep 1, 2007 IP
  2. cbn81

    cbn81 Peon

    Messages:
    160
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    cbn81, Sep 1, 2007 IP
  3. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #3
    ajsa52, Sep 1, 2007 IP
  4. m0nkeymafia

    m0nkeymafia Well-Known Member

    Messages:
    399
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    125
    #4
    What are you using printf for?
    I never use printf anymore and always use streams.

    I.e. if you want to put some text then a variable into a new variable you can do
    std::eek:stringstream newvar;
    newvar << "Hello your name is " << name;

    Its much easier than printf.
     
    m0nkeymafia, Sep 2, 2007 IP
  5. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #5
    Streams are for C++, and he/she is asking for C.
    Also, even on C++ if you want to format is some special way (leading zeros, adding plus sign, ...) IMO is easier with sprintf than with streams+modifiers.
     
    ajsa52, Sep 2, 2007 IP
  6. m0nkeymafia

    m0nkeymafia Well-Known Member

    Messages:
    399
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    125
    #6
    Ah didn't know it wasnt available in C, that sucks, streams rock!
     
    m0nkeymafia, Sep 2, 2007 IP