[UNIX / LINUX] fread, fwrite 함수 원형, 예제
//141005 Source by YoWu(uyu423@gmail.com) #include "stdio.h" #include "stdlib.h" int main(void) { FILE *rfp, *wfp; char buf[BUFSIZ]; int n; if((rfp = fopen("abc.txt", "r")) == NULL) { perror("fopen: abc.txt"); exit(1); } if((wfp = fopen("ac.txt", "w")) == NULL) { perror("fopen : ac.txt"); exit(1); } while((n=fread(buf, sizeof(char) * 2, 1, rfp)) > 0) { fwrite(buf, sizeof(char), n, wfp); } fclose..
컴퓨터공학
2014. 10. 5. 21:36