#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void main()
{
    FILE *fs,*ft;
    char ch;
    clrscr();
    fs = fopen("vk.txt","r");
    if(fs==NULL)
    {
    printf("Cannot open source file ! Press key to exit.");
    getch();
    exit(0);
    }
    ft = fopen("ck.txt","w");
    if(ft==NULL)
    {
    printf("Cannot copy file ! Press key to exit.");
    fclose(fs);
    getch();
    exit(0);
    }
    while(1)
    {
    ch = getc(fs);
    if(ch==EOF)
    {
    break;
    }
    else
    putc(ch,ft);
    }
    printf("File copied succesfully!");
    fclose(fs);
    fclose(ft);
}
 
 
 
 ^ Go to Top
^ Go to Top
No comments:
Post a Comment