|[ < ]||[ > ]||[ << ]||[ Up ]||[ >> ]||[Top]||[Contents]||[Index]||[ ? ]|
#include <stdio.h> int snprintf (char *buffer, size_t n, const char *format, ...);
This function works similarly to
sprintf() (see section sprintf), but
the size n of the buffer is also taken into account. This
function will write n - 1 characters. The nth character is used
for the terminating nul. If n is zero, buffer is not touched.
The number of characters that would have been written (excluding the trailing nul) is returned; otherwise -1 is returned to flag encoding or buffer space errors.
The maximum accepted value of n is
<limits.h>. -1 is returned and
errno is set to
EFBIG, if n is greater than this limit.
|ANSI/ISO C||C89; C99 (see note 1)|
|webmaster||delorie software privacy|
|Copyright © 2004||Updated Apr 2004|