#include
#define MAX 100
int main(int argc, char *argv[])
{
char buf[MAX];
FILE *fpr, *fpw;
char ch;
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;
}
// printf("readfile number is %d\n", fpr->_fileno);
if ((fpw = fopen(argv[2], "w")) == NULL)
{
printf("open target is error\n");
return -1;
}
while (fgets(buf, MAX, fpr) != NULL)
{
fputs(buf, fpw);
}
return 0;
}
阅读(1103) | 评论(0) | 转发(1) |