Hacker News new | ask | show | jobs
by reality_czech 3108 days ago
The cheap jabs are all incorrect, as well. Any compiler from the last 10 years will warn you if you don't match your printf format string to the arguments. printf also supports reordering arguments using the %m$ syntax (read the man page). And yes, you can extend printf with your own types.

A better guide to using strings in C++ is here: https://yosefk.com/c++fqa/io.html

1 comments

Does the compiler also warn when you don't use a literal format string?