When told to print no more than n bytes, snprintf guarantees that it creates a string of length no more than n-1, with a null terminator at the end of the string.
当被告知输出不超过 n 个字节时, snprintf 保证会创建一个长度不超过 n-1 的字符串,字符串最后是一个空结束符。
So int n just gives me four bytes for an int, but it doesn't put anything there yet.
所以int,n只是给我们分配了4个字节,但是它没有放任何东西在那里。
应用推荐