[Solved] Copy one image file to another [closed]


Why don’t you just make it simple:

#include<stdio.h>
#include<stdlib.h>

int main()
{
    FILE *fs,*ft;
    int ch;

    fs=fopen("your/file/path","rb");
    if(fs==NULL)
    {
        puts("Unable to open source!");
        exit(1);
    }
    ft=fopen("new/file/path","wb");
    if(ft==NULL)
    {
        puts("Unable to copy!");
        fclose(fs);
        exit(2);
    }

    while(1)
    {
        ch=fgetc(fs);
        if(ch==EOF) break;
        fputc(ch,ft);
    }
    fclose(fs);
    fclose(ft);
    return 0;
}

5

solved Copy one image file to another [closed]