snprintf、strncpy、strncat
时间:2010-11-12 来源:Ray001
strncpy(var, sth, sizeof(var) - 1);
var[sizeof(var) - 1] = '\0';
snprintf(var, sizeof(var), fmt, ...);
strncat(dest, src, sizeof(dest) - 1 - strlen(dest));
dest[sizeof(dest) - 1] = '\0';
var[sizeof(var) - 1] = '\0';
snprintf(var, sizeof(var), fmt, ...);
strncat(dest, src, sizeof(dest) - 1 - strlen(dest));
dest[sizeof(dest) - 1] = '\0';
相关阅读 更多 +