VMS Help CC, Run-time functions, printf, Conversion Specifier *Conan The Librarian (sorry for the slow response - running on an old VAX) |
d, i Converts an int argument to signed decimal format. o Converts an unsigned int argument to unsigned octal format. u Converts an unsigned int argument to unsigned decimal format (giving a number in the range 0 to 4,294,967,295). x, X Converts an unsigned int argument to unsigned hexadecimal format (with or without a leading 0x). The letters 'abcdef' are used for the x conversion; the letters 'ABCDEF' are used for the X conversion. f Converts a float or double argument to the format [-]mmm.nnnnnn. The number of n's is equal to the precision specification. If no precision is specified, the default is 6. If the precision is 0 and the # flag is specified, the decimal point appears but no n's appear. If the precision is 0 and the # flag is not specified, the decimal point also does not appear. If a decimal point appears, at least one digit appears before it. The value is rounded to the appropriate number of digits. e, E Converts a float or double argument to the format [-]m.nnnnnnE[+|-]xx. The number of n's is specified by the precision. If no precision is specified, the default is 6. If the precision is explicitly 0 and the # flag is specified, the decimal point appears but no n's appear. If the precision is explicitly 0 and the # flag is not specified, the decimal point also does not appear. An 'e' is printed for e conversion; an 'E' is printed for E conversion. The exponent always contains at least two digits. If the value is 0, the exponent is 0. g, G Converts a float or double argument to format f or e (or E if the G conversion specifier is used), with the precision specifying the number of significant digits. If the precision is 0, it is taken as 1. c Converts an int argument to an unsigned char, and writes the resulting character (null characters are ignored). C Converts a wchar_t argument to an array of bytes representing the character, and writes the resulting character. If the field width is specified and the resulting character occupies fewer bytes than the field width, it will be padded to the given width with space characters. If the precision is specified, the behavior is undefined. s Requires an argument that is a pointer to an array of characters of type char. The argument is used to write characters until a null character is encountered or until the number of characters indicated by the precision specification is exhausted. If the precision specification is 0 or omitted, all characters up to a null are output. S Converts an array of wide-character codes to multibyte characters, and writes the multibyte characters. Requires an argument that is a pointer to an array of wide characters of type wchar_t. Characters are written until a null wide character is encountered or until the number of bytes indicated by the precision specification is exhausted. If the precision specification is omitted or is greater than the size of the array of converted bytes, the array of wide characters must be terminated by a null wide character. p Requires an argument that is a pointer to void. The value of the pointer is output as a hexadecimal character. n Requires an argument that is a pointer to an integer. The integer is assigned the number of characters written to the output stream so far by this call to the formatted output function. No argument is converted. % Writes out the percent symbol. No conversion is performed. The complete conversion specification would be %%.
|