This is my file copying code:
void main()
{
char c;
FILE *fptr1, *fptr2;
fptr1=fopen("abc.docx","r");
fptr2=fopen("paste_here.docx","w");
c=fgetc(fptr1);
while (c!=EOF)
{
putc(c,fptr2);
c=fgetc(fptr1);
}
fclose(fptr1);
fclose(fptr2);
}
I expected the contents to get copied but whenever I try to open paste_here.docx
file after running this, it says that the file can't be opened as there are problems with the contents.