标签:res sprintf span 编译器 snprintf check ext nes print
int sprintf_s(char *restrict buffer, rsize_t bufsz,
const char *restrict format, ...);
sprintf_s原先只有windows的编译器才只支持,但是在C11之后,也加入了该函数。
Linux中有类似的函数实现,但是不完全相同,snprintf:
int snprintf( char *restrict buffer, int bufsz,
const char *restrict format, ... );
As all bounds-checked functions, printf_s
, fprintf_s
, sprintf_s
, and snrintf_s
are only guaranteed to be available if __STDC_LIB_EXT1__ is defined by the implementation
and if the user defines __STDC_WANT_LIB_EXT1__ to the integer constant 1 before including <stdio.h>
.
标签:res sprintf span 编译器 snprintf check ext nes print
原文地址:http://www.cnblogs.com/dirt2/p/6104198.html