Thread: Copy Program

  1. #1
    Registered User
    Join Date
    Nov 2011
    Posts
    39

    Copy Program

    Can anyone teach me how to make a copy program in C to copy all kinds of files and stuff.

    PS: Please add comments and guides in the code.

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    What have you tried?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Nov 2011
    Posts
    39
    Nuthin really i just dont know how to start.

  4. #4
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    Code:
    #include <stdio.h>
    #include <string.h>
    
    int main(void)
    {
        // character array declarations
        char str1[] = "all kinds of files and stuff.";
        char str2[50];
    
        // string copy function
        strcpy(str2,str1);
    
        printf("\n%s\n",str2);
    
        return 0;
    }
    You might also have some luck by trying this.

  5. #5
    Registered User ledow's Avatar
    Join Date
    Dec 2011
    Posts
    435
    Judging by some of their previous threads, and the tone of "copying all kinds of files and stuff", methinks the OP would prefer a Write-A-Virus kind of program. Ironically, if he actually started learning some C the day he joined the forums, he probably wouldn't need to ask.

    Help please
    Help again!
    Help
    Malicious Programs

    - Compiler warnings are like "Bridge Out Ahead" warnings. DON'T just ignore them.
    - A compiler error is something SO stupid that the compiler genuinely can't carry on with its job. A compiler warning is the compiler saying "Well, that's bloody stupid but if you WANT to ignore me..." and carrying on.
    - The best debugging tool in the world is a bunch of printf()'s for everything important around the bits you think might be wrong.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Console Copy Program in C++
    By kaveh8 in forum C++ Programming
    Replies: 2
    Last Post: 05-08-2011, 02:13 AM
  2. Get program to copy itself into program files, then start on startup.
    By guitarist809 in forum Windows Programming
    Replies: 6
    Last Post: 03-03-2008, 09:42 AM
  3. C program to copy log file frm database
    By nirmala.s in forum C Programming
    Replies: 15
    Last Post: 11-27-2006, 11:05 AM
  4. Making a program copy itself
    By kzar in forum C Programming
    Replies: 6
    Last Post: 05-29-2006, 03:13 AM
  5. Best software copy protection program
    By axr0284 in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 12-09-2004, 09:07 AM