Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
SamReidHughes
on July 3, 2011
|
parent
|
context
|
favorite
| on:
Learn C The Hard Way
d for decimal?
getsat
on July 3, 2011
[–]
Right, but I've never seen it used with integers. %.2d is probably the most common format I've seen. Messing up your format strings is a common exploitation vector, so I was wondering if he had typo'd that or otherwise used it accidentally.
palish
on July 3, 2011
|
parent
[–]
You mean %.2f ? %d is for integers, %f is for reals (yo).
zedshaw
on July 3, 2011
|
root
|
parent
|
next
[–]
Oh I'm totally using that.
irahul
on July 3, 2011
|
root
|
parent
|
prev
[–]
I much prefer using %g for the general scenario.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: