Definition | #include <stdio.h> int puts(const char *s);
| ||
Return val. | 0 | if successful. | |
EOF | otherwise. | ||
Notes | In contrast to The terminating null byte of s is not output. For further information on output to text files and on converting the control characters for white space (\n, \t, etc.) see section “White space” (Basic terms). The following applies in the case of text files with SAM access mode and variable record length for which a maximum record length is also specified: When the specification | ||
Example | This example shows how #include <stdio.h> int main(void) { FILE *fp; char s[BUFSIZ]; fp=fopen("file","w"); while(gets(s) != NULL) { fputs(s,fp); puts(s); } return 0; } If you look at file after this program has run, you will see that the strings from the input ( | ||
See also | fputs, gets, fgets, putws, sprintf, snprintf |