1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Rep Power

    Guide for placeholders

    Is there a page for placeholders what the man page is to various functions in C?

    I want to know what exactly the placeholders do in my formatting string without having to experiment each time.
    (for example, if I scan 3.145xyz with %d%c, will I get 3 and x stored or will I get 3 and . instead?)
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Woodland Hills, Los Angeles County, California, USA
    Rep Power
    You could look at the man page for printf(), which describes what the various formats are. For the record, you'll get 3 and . in the above code.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  4. #3
  5. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Rep Power
    It would be better to read the man page for scanf(), which also contains that information, but with explanations pertinent to scanf(). With scanf, the size of the conversion is much more important than with printf. Plus there's the set notation using square brackets that I don't think printf has.

IMN logo majestic logo threadwatch logo seochat tools logo