Hacker News new | past | comments | ask | show | jobs | submit login

Would printf even exist if C had sane strings?



How is formatted printing related in any way to the internal representation of strings?

printf is what you call when you want to print X in hexadecimal with at least two digits, left justified on an eight-character wide field. I don't see how the sanity of whatever string representation the programming language uses is relevant here.


Some kind of formatting function would because sometimes, you really do need to print an integer with enough leading zeroes to fit in a five-digit field.


printf exists in Java. Because its so bloody useful.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: