snprintf和sprintf返回值的区别


snprintf若成功则返回欲写入的字符串长度,若出错则返回负值。
与snprintf的返回值不同,sprintf的返回值是成功写入的字符串长度。