Is there a way to fix the format specifier warnings for stdint types?
3 answers
Pascal's solution is the most direct and most idiomatic for a given particular type, but for writing is an alternative for printing arbitrary integer types whose definitions you don't know, just cast to intmax_t
or uintmax_t
, then using j
(for example, %jd
or %ju
). However, this may not work for most / all versions of the MSVC standard library as they are lagging behind standards compliance.
+4
source to share