9

In the following page, I found the code like

CERT INT15-C Use intmax_t or uintmax_t for formatted IO on programmer-defined integer types

uintmax_t temp;

if(scanf("%ju", &temp) != 1) {
   ...

I am not familiar with the "%ju" specifier. And I am not successful in finding the explanation of the "%ju" on the Internet.

Is this defined by some specific compiler environment, or generally used one?

sevenOfNine
  • 1,509
  • 16
  • 37

1 Answers1

11

%ju is just the %u (unsigned) format with a j length modifier, the latter being defined in the C99 standard as:

j — Specifies that a following d, i, o, u, x, X, or n conversion specifier applies to an argument with type pointer to intmax_t or uintmax_t.

jwodder
  • 54,758
  • 12
  • 108
  • 124