They are declared in <inttypes.h> as macros: SCNd8, SCNd16, SCNd32 and SCNd64. Example (for int32_t):
sscanf (line, "Value of integer: %" SCNd32 "\n", &my_integer);
Their format is PRI (for printf) / SCN (for scanning), then o, u, x, X d, I for the corresponding qualifier, then nothing, LEAST, FAST, MAX, and then the size (obviously, for the maximum size). Some other examples: PRIo8, PRIuMAX, SCNoFAST16.
Edit: BTW a related question asked why this method was used. You can find answers to interesting questions.
AProgrammer Aug 09 2018-11-11T00: 00Z
source share