MicrOS
sprintf.c File Reference
#include "../stdio.h"
#include <stdarg.h>

Functions

int sprintf (char *str, const char *format,...)
 Write formatted data to string. More...
 

Function Documentation

◆ sprintf()

int sprintf ( char *  str,
const char *  format,
  ... 
)

Write formatted data to string.

Composes a string with the same text that would be printed if format was used on printf, but instead of being printed, the content is stored as a C string in the buffer pointed by str.

Parameters
strPointer to a buffer where the resulting C-string is stored. The buffer should be large enough to contain the resulting string.
formatString that contains text to be written to buffer. Can contain embedded format specifiers.
...Additional arguments
Returns
Total number of characters written to buffer