RAD Studio
ContentsIndex
PreviousUpNext
_vsnprintf;_vsnwprintf

Header File 

stdio.h 

Category 

Memory and String Manipulation Routines 

Prototype 

int _vsnprintf(char* buffer, size_t nsize, const char* format, va_list param); 

int _vsnwprintf(wchar_t* buffer, size_t nsize, const wchar_t* format, va_list param); 

Description 

Sends formatted output to a string of a maximum length specified by nsize. _vsnprintf and _vsnwprintf are Microsoft compatible with the _vsnprintf and _vsnprintfw functions, respectively. 

If the number of bytes to output is:

  • < nsize, then all of the characters have been written, including the terminating ‘\0’ character.
  • == nsize, then nsize characters are written with no terminating ‘\0’ character.
If nsize is 0, then the string will not be written to (and may be NULL). 

If nsize is too small, then return value is -1, and only nsize characters are written, with no terminating ‘\0’ character. 

Return Value 

Number of bytes output or –1 if nsize is too small.

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!