Loading...
Select Version
&pagelevel(4)&pagelevel
Definition | #include <stdio.h> int fputc(int c, FILE *fp);
| |
Return val. | Written character c as a positive integer value | |
if successful. | ||
EOF | otherwise. | |
Notes | The characters are not written immediately to the external file but are stored in an internal Control characters for white space (\n, \t, etc.) are converted to their appropriate effect when | |
Example | The following program reads characters from SYSDTA and outputs them to SYSOUT. #include <stdio.h> #include <stdlib.h> void copy(void); FILE *fp_in, *fp_out; int main(void) { fp_in = fopen("(SYSDTA)","r"); fp_out = fopen ("(SYSOUT)","w"); copy(); fclose(fp_in); fclose(fp_out); return 0; } void copy(void) { int c; while((c = fgetc(fp_in)) != EOF) fputc((char)c,fp_out); } | |
See also | fopen, fopen64, fputwc, putc, putchar |