#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
int main(int argc,char *argv[])
{
FILE *to,*from;
size_t size;
char buf[100];
if(argc != 3){
printf("usage:%s {fromFile} {toFile}\n",argv[0]);
exit(-1);
}
from = fopen(argv[1],"rb");
if(!from)
{
printf("open %s failed:%s\n",argv[1],strerror(errno));
exit(-1);
}
to = fopen(argv[2],"wb");
if(!to)
{
printf("open %s failed:%s\n",argv[2],strerror(errno));
exit(-1);
}
while((size = fread(buf,1,sizeof(buf),from)) == sizeof(buf))
{
#include <errno.h>
#include <stdlib.h>
#include <string.h>
int main(int argc,char *argv[])
{
FILE *to,*from;
size_t size;
char buf[100];
if(argc != 3){
printf("usage:%s {fromFile} {toFile}\n",argv[0]);
exit(-1);
}
from = fopen(argv[1],"rb");
if(!from)
{
printf("open %s failed:%s\n",argv[1],strerror(errno));
exit(-1);
}
to = fopen(argv[2],"wb");
if(!to)
{
printf("open %s failed:%s\n",argv[2],strerror(errno));
exit(-1);
}
while((size = fread(buf,1,sizeof(buf),from)) == sizeof(buf))
{