Путеводитель по Руководству Linux

  User  |  Syst  |  Libr  |  Device  |  Files  |  Other  |  Admin  |  Head  |



   snprintf    ( 3 )

преобразование форматированного вывода (formatted output conversion)

  Name  |  Synopsis  |  Description  |  Return value  |  Attributes  |    Conforming to    |  Note  |  Bugs  |  Examples  |  See also  |

Стандарты (Conforming to)

fprintf(), printf(), sprintf(), vprintf(), vfprintf(), vsprintf(): POSIX.1-2001, POSIX.1-2008, C89, C99.

snprintf(), vsnprintf(): POSIX.1-2001, POSIX.1-2008, C99.

The dprintf() and vdprintf() functions were originally GNU extensions that were later standardized in POSIX.1-2008.

Concerning the return value of snprintf(), SUSv2 and C99 contradict each other: when snprintf() is called with size=0 then SUSv2 stipulates an unspecified return value less than 1, while C99 allows str to be NULL in this case, and gives the return value (as always) as the number of characters that would have been written in case the output string has been large enough. POSIX.1-2001 and later align their specification of snprintf() with C99.

glibc 2.1 adds length modifiers hh, j, t, and z and conversion characters a and A.

glibc 2.2 adds the conversion character F with C99 semantics, and the flag character I.