Integer Example - %i Syntax - %@ //String
- %d //Signed 32-bit integer
- %D //Signed 32-bit integer
- %u //Unsigned 32-bit integer
- %U //Unsigned 32-bit integer
- %x //Unsigned 32-bit integer in lowercase hexadecimal format
- %X //Unsigned 32-bit integer in UPPERCASE hexadecimal format
- %o //Unsigned 32-bit integer in octal format
- %O //Unsigned 32-bit integer in octal format
- %f //64-bit floating-point number
- %F //64-bit floating-point number printed in decimal notation
- %e //64-bit floating-point number in lowercase scientific notation format
- %E //64-bit floating-point number in UPPERCASE scientific notation format
- %g //special case %e which uses %f when less than 4 sig-figs are available, else %e
- %G //special case %E which uses %f when less than 4 sig-figs are available, else %E
- %c //8-bit unsigned character
- %C //16-bit UTF-16 code unit
- %s //UTF8 String
- %S //16-bit variant of %s
- %p //Void Pointer in lowercase hexidecmial format with leading '0x'
- %zx //special case %p which removes leading '0x' (For use with no-type cast)
- %a //64-bit floating-point number in scientific notation with leading '0x' and one hexadecimal digit before the decimal point using a 'p' to notate the exponent.
- %A //64-bit floating-point number in scientific notation with leading '0x' and one hexadecimal digit before the decimal point using an 'P' to notate the exponent.
Due to the nature of format-specifiers, if you wish to include the percentage symbol (%) in your string, you must escape it using a second percentage symbol. Example: No Format Specifier for BOOL-type exists. Common-use solutions include: Which utilizes a ternary operator for casting a string-equivalent. Which utilizes an (int) cast for implanting a binary-equivalent. |