Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

copying contents of a file to another?

Status
Not open for further replies.

ncwizad

Programmer
Aug 25, 2005
10
GB
Hello,
Is there a simple way of copying one file into another from within an application.
Basically i'm writing a log file of the success/failiure of th e application. At the end it would be helpful to have a record of the data used in the application.
Ideally a function similar to fprintf(inputfile,"format",string);
except substituting the string for an axisting file.
 
Given two suitably opened files, this copies the file.
Code:
int ch;
while ( (ch=fgetc(in)) != EOF ) fputc(ch,out);

--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top