I would use a ssytem facility for just copying files (e.g. system("cp filein fileout"); on linux). Anyway the correct code to accomplish that should be
#include <stdio.h>
int main()
{
FILE * fpin, *fpout;
int i;
fpin = fopen("parse.txt", "r");
if ( !fpin )
{
}
fpout = fopen("dpl.txt", "w");
if (!fpout)
{
}
while ( (i = fgetc(fpin) ) != EOF )
{
fputc(i, fpout);
}
fclose(fpout);
fclose(fpin);
return 0;
}
Please note that errors on
fopen
must be properly handled (e.g. in all but trivial test programs, the acquired resources must be released).