| |||
Home > The C and C++ Libraries > C library extensions > vsnprintf() |
vsnprintf()
worksalmost exactly like
the ANSI vsprintf()
function, except that the caller
can specify the maximum size of the buffer. The return value is
the length of the complete formatted string that would have been
written if the buffer were big enough. Therefore, the string written
into the buffer is complete only if the return value is at least zero
and at most n-1
.
The
parameter
specifies the number of characters of bufsize
that
the function can write into, including the
terminating null.buffer
<stdio.h>
is an ANSI header file,
but the function is not allowed by the ANSI C library standard.
It is therefore not available if you use the compilers with the -strict
option.