Synopsis
#include <stdio_c.h>
int sprintf_c(__code char *s, const char *format, ...);
Description
sprintf_c writes to the string pointed to by s under control of the string pointed to by format that specifies how subsequent arguments are converted for output. A null character is written at the end of the characters written; it is not counted as part of the returned value. The format string is stored in flash (code) memory.
If there are insufficient arguments for the format, the behavior is undefined. If the format is exhausted while arguments remain, the excess arguments are evaluated but are otherwise ignored.
If copying takes place between objects that overlap, the behavior is undefined.
sprintf_c returns number of characters transmitted (not counting the terminating null), or a negative value if an output or encoding error occurred.
Portability
sprintf_c is an extension provided by CrossWorks C.