Common mistakes in creating format strings include:
- using Using invalid conversion specifiers
- using Using a length modifier on an incorrect specifier
- mismatching Mismatching the argument and conversion specifier type
- using Using invalid character classes
Wiki Markup |
---|
The following are C99 \[[ISO/IEC 9899-1999|AA. C References#ISO/IEC 9899-1999]\] compliant conversion specifiers. Using any other specifier may result in [undefined behavior|BB. Definitions#undefined behavior]. |
Code Block |
---|
d, i, o, u, x, X, f, F, e, E, g, G, a, A, c, s, p, n, % |
...
Character class ranges must also be properly specified , with a hyphen in between two printable characters. The two following lines are both properly specified. The first accepts any character from a-z, inclusive, while the second accepts anything that is not a-z, inclusive.
...