- 論壇徽章:
- 0
|
不知道你看的什么函數(shù)手冊,那個有點慘不忍睹。
man sprintf
int sprintf(char *str, const char *format, ...);
sprintf(), snprintf(), vsprintf() and vsnprintf() write to the character string str.
The functions snprintf() and vsnprintf() write at most size bytes
(including the trailing null byte ('\0')) to str.
最后一句指出了,他們都會往str輸出一個'\0'
再參考C:A Reference Manual 15.11節(jié)
int sprintf(char * restrict *s, const char * resctrict format, ...);
sprintf函數(shù)是輸出字符被存儲到字符串緩沖區(qū)s。在控制字符串所指定的所有字符都被輸出之后,它會向s輸出一個結尾的null字符....
把你手上的那個參考手冊扔掉吧。 |
|