Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

d for decimal?


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.


You mean %.2f ? %d is for integers, %f is for reals (yo).


Oh I'm totally using that.


I much prefer using %g for the general scenario.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: