July 19th, 2013, 05:47 AM
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?)
July 19th, 2013, 11:03 AM
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
July 19th, 2013, 04:49 PM
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.