3 ms·
And at least on clang, printf is somewhat typesafe. If you write %s and pass an int, it will give you a warning. This also works if you are using a wrapper that
by captainmuon 6y ago
And at least on clang, printf is somewhat typesafe. If you write %s and pass an int, it will give you a warning. This also works if you are using a wrapper that ultimatively calls printf!
Constrast with cout, which will happily let you print out the wrong variable. It won't print out garbage of course because it helpfully knows to print out the int differently, but it can't give you a warning. Also, it's difficult to do localization with it.