Thread: how to append one file into the other file

  1. #1
    Registered User
    Join Date
    Aug 2009
    Posts
    168

    how to append one file into the other file

    file1:
    ABCVD
    ABDDD

    file2
    adf
    dfff

    Code:
    appendFill(char *file1,char *file2)
    {
           
    }
    output:
    file1:
    ABCVD
    ABDDD
    adf
    dfff


    how to append one file into the other file?
    it means joining two files.

  2. #2
    Registered User
    Join Date
    Oct 2008
    Location
    TX
    Posts
    2,059
    seek the end of file1, read from file2, and write to file1.

  3. #3
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by itCbitC View Post
    seek the end of file1, read from file2, and write to file1.
    Or just open file1 in append mode...
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  4. #4
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,229
    Code:
    cat file2 >> file1

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. opening empty file causes access violation
    By trevordunstan in forum C Programming
    Replies: 10
    Last Post: 10-21-2008, 11:19 PM
  2. System
    By drdroid in forum C++ Programming
    Replies: 3
    Last Post: 06-28-2002, 10:12 PM
  3. Hmm....help me take a look at this: File Encryptor
    By heljy in forum C Programming
    Replies: 3
    Last Post: 03-23-2002, 10:57 AM
  4. Need a suggestion on a school project..
    By Screwz Luse in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 02:58 AM