#include
#define BUFF 50
int main(int argc, char *argv[])
{
FILE *fpr, *fpw;
int realsize;
char buf[BUFF];
if (argc != 3)
{
printf("argument is error\n");
return -1;
}
if ((fpr = fopen(argv[1], "r")) == NULL)
{
printf("open source is error\n");
return -1;
}
if ((fpw = fopen(argv[2], "w")) == NULL)
{
printf("open target is error\n");
return -1;
}
while ((realsize = fread(buf, sizeof(char), BUFF, fpr)) > 0)
{
fwrite(buf, sizeof(char), realsize, fpw);
}
return 0;
}
阅读(1051) | 评论(0) | 转发(1) |