Conversion Specifier %Ju

Conversion Specifier %Ju

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?

1 Answer

%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.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Elena Rostova
Author

Elena Rostova

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.