The GNU C Library - Table of Input Conversions
Node: Table of Input Conversions
Next: Numeric Input Conversions
Prev: Input Conversion Syntax
Up: Formatted Input
Table of Input Conversions
Here is a table that summarizes the various conversion specifications:
-
`%d'
-
Matches an optionally signed integer written in decimal. See Numeric Input Conversions.
-
`%i'
-
Matches an optionally signed integer in any of the formats that the C language defines for specifying an integer constant. See Numeric Input Conversions.
-
`%o'
-
Matches an unsigned integer written in octal radix. See Numeric Input Conversions.
-
`%u'
-
Matches an unsigned integer written in decimal radix. See Numeric Input Conversions.
-
`%x', `%X'
-
Matches an unsigned integer written in hexadecimal radix. See Numeric Input Conversions.
-
`%e', `%f', `%g', `%E', `%G'
-
Matches an optionally signed floating-point number. See Numeric Input Conversions.
-
`%s'
-
Matches a string containing only non-whitespace characters. See String Input Conversions.
-
`%['
-
Matches a string of characters that belong to a specified set. See String Input Conversions.
-
`%c'
-
Matches a string of one or more characters; the number of characters read is controlled by the maximum field width given for the conversion. See String Input Conversions.
-
`%p'
-
Matches a pointer value in the same implementation-defined format used by the `%p' output conversion for
printf
. See Other Input Conversions.
-
`%n'
-
This conversion doesn't read any characters; it records the number of characters read so far by this call. See Other Input Conversions.
-
`%%'
-
This matches a literal `%' character in the input stream. No corresponding argument is used. See Other Input Conversions.
If the syntax of a conversion specification is invalid, the behavior is undefined. If there aren't enough function arguments provided to supply addresses for all the conversion specifications in the template strings that perform assignments, or if the arguments are not of the correct types, the behavior is also undefined. On the other hand, extra arguments are simply ignored.
Next: Numeric Input Conversions
Up: Formatted Input