1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Dos Copy command

Discussion in 'C' started by gameon, Aug 28, 2010.

  1. gameon

    gameon New Member

    Joined:
    Aug 28, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    I am trying to make a c programe which will work like dos copy command.
    I am able to copy the one txt file but this programe is not working with other extension file.

    Void main()
    {
    FILE *fp,*fp1;
    char c;

    fp=fopen("source","r");
    fp1=fopen(" destination","w");

    while((c=getc(fp))!=EOF)
    putc(c,fp1);
    fclose(fp1);
    fclose(fp);
    }
     

Share This Page