Definition | #include <stdio.h> int putw(int w, FILE *fp)
| ||
Return val. | The written w EOF | if successful. otherwise. | |
Notes | Since word length and the order of bytes are system-dependent, it is possible that files Since 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 transfers the contents of the file input to the file output, one word at #include <stdio.h> FILE *fp_in, *fp_out; int w; int main(void) { fp_in = fopen("input","r"); fp_out = fopen("output","w"); while(!feof(fp_in) && !ferror(fp_in) && !ferror(fp_out)) { w = getw(fp_in); putw(w,fp_out); } fclose(fp_in); fclose(fp_out); return 0; } | ||
See also | getw |