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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice