vsprintf.c
来自「德州仪器(TI) 的超低功耗16 位RISC 混合信号处理器的MSP430 平台」· C语言 代码 · 共 27 行
C
27 行
/* - VSPRINTF.C -
The ANSI "vsprintf" function.
$Revision: 1.3 $
Copyright 1986 - 1999 IAR Systems. All rights reserved.
*/
#include "stdarg.h"
#include "stdio.h"
#include "icclbutl.h"
static void put_c_in_string(char c, void *ptr) /* Low-level output */
{
*(*(char **) ptr)++ = c;
}
int vsprintf(char *s, const char *format, va_list ap)
{
int nr_of_chars;
nr_of_chars = _formatted_write(format, put_c_in_string, (void *) &s, ap);
*s = '\0'; /* String should be terminated with NUL */
return nr_of_chars; /* According to ANSI */
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?