Print formatted output to a string, up to a given maximum number of characters
char * qdb_snprintf( int n,
const char *format, ...);
- The maximum number of characters to store in the buffer, including a terminating null character. The function will always write a zero-terminator if n is positive.
- A pointer to the buffer where you want the function to store the formatted string.
- A pointer to a formatting string to process. The formatting string determines what additional arguments you need to provide. For more information, see printf() in the Neutrino Library Reference.
This function is a variant of the snprintf() from the standard C library. However, it is different from snprintf() in these ways:
- qdb_snprintf() returns a pointer to the buffer rather than the number of characters written
- the order of the n and buf parameters is reversed
- qdb_snprintf() always writes a zero-terminator if n is positive
For more information about additional formatting options, see qdb_mprintf().
||You shouldn't use the return value of this function. In future versions, it may be changed to return the number of characters written rather than a pointer to the buffer.|
- A pointer to buf
- An error occurred (errno is set).
printf() in the Neutrino Library Reference