fputs的wen't
#include <stdio.h>#define STLEN 14
int main(void)
{
char words;
puts("Enter a string,please.");
fgets(words, STLEN, stdin);
printf("Your string twice (puts(), then fputs()):\n");
puts(words);
fputs(words, stdout);
puts("Enter another string,please.");
fgets(words, STLEN, stdin);
printf("Your string twice (puts(), then fputs()):\n");
puts(words);
fputs(words, stdout);
puts("Done.");
getchar();
return 0;
}
为什么第一个fputs打印完后,下一个打印会换行,
而第二个fputs打印完之后,打印“Done”就不会换行?
不知道你想说什么,我看没区别
Notice that fputs not only differs from puts in that the destination stream can be specified, but also fputs does not write additional characters, while puts appends a newline character at the end automatically. ba21 发表于 2019-6-2 00:14
不知道你想说什么,我看没区别
第二个fputs书上是连接着Done的
xypmyp 发表于 2019-6-2 06:15
Notice that fputs not only differs from puts in that the destination stream can be specified, but al ...
but the frist fputs appends a newline xypmyp 发表于 2019-6-2 06:15
Notice that fputs not only differs from puts in that the destination stream can be specified, but al ...
I understand
页:
[1]