File Copying


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

int main(){

    FILE *source,*destination;
    char ch;
    source = fopen("handsmat.ascii.pgm","r");
    destination = fopen("new1.ascii.pgm","w");
    while((ch= fgetc(source)) != EOF){
        fputc(ch,destination);
    }
    fclose(source);
    fclose(destination);
    return 0;
}

Comments

Popular Posts