sprintf()和snprintf()

int snprintf ( char * s, size_t n, const char * format, ... );


int sprintf ( char * str, const char * format, ... );
格式化字符串,snprintf()的第二个参数size_t n限制字符串的长度,防止溢出

猜你喜欢

转载自blog.csdn.net/fanx021/article/details/80189050