Definition | #include <stdio.h> int fputs(const char *s, FILE *fp);
| ||
Return val. | 0 EOF | if successful. otherwise. | |
Notes | In contrast to The terminating null byte of s is not output. Control characters for white space (\n, \t, etc.) are converted to their appropriate effect when The following applies in the case of text files with SAM access mode and variable record |
Example | The following program reads strings from file and then outputs them at the display terminal #include <stdio.h> int main(void) { FILE *fp_in, *fp_out; char s[BUFSIZ]; int max = 120; fp_in = fopen("file","r"); fp_out = fopen("(SYSOUT)","w"); while(fgets(s, max, fp_in) != NULL) fputs(s, fp_out); return 0; } |
See also | fopen, fopen64, puts, fgets |