Standard C++ Library Reference ISO/IEC (VERSION3)
Scan Conversion Specifiers
Following any field width, you must write a one-character scan conversion specifier, either a
one-character code or a scan set, possibly preceded by a one-character qualifier. Each
combination determines the type required of the next argument (if any) and how the scan
functions interpret the text sequence and converts it to an encoded value. The integer and
floating-point conversions also determine what base to assume for the text representation. (The
base is the base argument to the functions strtol and strtoul.) The following table lists
all defined combinations and their properties.
Conversion Argument Conversion
Specifier Type Function Base
%c char x[]
%lc wchar_t x[]
%d int *x strtol 10
%hd short *x strtol 10
%ld long *x strtol 10
%e float *x strtod 10
%le double *x strtod 10
%Le long double *x strtod 10
%E float *x strtod 10
%lE double *x strtod 10
%LE long double *x strtod 10
%f float *x strtod 10
%lf double *x strtod 10
%Lf long double *x strtod 10
%g float *x strtod 10
%lg double *x strtod 10
%Lg long double *x strtod 10
%G float *x strtod 10
%lG double *x strtod 10
%LG long double *x strtod 10
%i int *x strtol 0
%hi short *x strtol 0
%li long *x strtol 0