#include <stdio.h>
#include <math.h>
#include <string.h>
int main(void){
FILE * src=fopen("simple.bin", "rb");
FILE * des=fopen("dst.bin", "wb");
char buf[20];
int readCnt;
if(src==NULL || des == NULL)
{
puts("파일오픈 실패!");
return -1;
}
while(1)
{
readCnt=fread((void*)buf, 1, sizeof(buf), src);
if(readCnt<sizeof(buf))
{
if(feof(src)!=0)
{
fwrite((void*)buf, 1, readCnt, des);
puts("파일복사 완료");
break;
}
else
puts("파일복사 실패");
break;
}
fwrite((void*)buf, 1, sizeof(buf), des);
}
fclose(src);
fclose(des);
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: