SlideShare a Scribd company logo
www.w3professors.com

/***

Program to Copy Contents of One File to Another

#include <stdio.h>
main()
{
FILE *fp1, *fp2;
char ch;
fp1 = fopen("abc.txt", "r");
fp2 = fopen("xyz.txt", "w");
while((ch = getc(fp1)) != EOF)
putc(ch, fp2);
fclose(fp1);
fclose(fp2);
getch();
}

Gursharan Singh Tatla

Page No. 1

***/

More Related Content

PPTX
Data File Handiling File POINTERS IN C++
DOCX
Jose dossantos.doc
PPTX
Linux comands for Hadoop
PPTX
Cis 216 – shell scripting
PPTX
Process monitoring in UNIX shell scripting
PDF
Workshop programs
PPTX
working with files
PDF
Need It Robust? Make It Fragile!
Data File Handiling File POINTERS IN C++
Jose dossantos.doc
Linux comands for Hadoop
Cis 216 – shell scripting
Process monitoring in UNIX shell scripting
Workshop programs
working with files
Need It Robust? Make It Fragile!

What's hot (20)

PDF
GoLang & GoatCore
PDF
Tests unitaires pour PostgreSQL avec pgTap
PDF
C++ prgms io file unit 7
PPTX
File handling in C
DOCX
java copy file program
PDF
Cpp lab 13_pres
TXT
Code
PDF
The Ring programming language version 1.2 book - Part 15 of 84
PPSX
C programming file handling
PPT
File handling
PDF
Linear queue
DOCX
source code which create file and write into it
PDF
14. fiile io
PPTX
File handling in c
PDF
BOSH deploys distributed systems, and Diego runs any containers
PDF
Doubly Linked List
PDF
Unix commands
PPTX
Commit2015 kharchenko - python generators - ext
PDF
Fail Fast. Into User's Face.
DOCX
GoLang & GoatCore
Tests unitaires pour PostgreSQL avec pgTap
C++ prgms io file unit 7
File handling in C
java copy file program
Cpp lab 13_pres
Code
The Ring programming language version 1.2 book - Part 15 of 84
C programming file handling
File handling
Linear queue
source code which create file and write into it
14. fiile io
File handling in c
BOSH deploys distributed systems, and Diego runs any containers
Doubly Linked List
Unix commands
Commit2015 kharchenko - python generators - ext
Fail Fast. Into User's Face.
Ad

Program to-copy-contents-of-one-file-to-another

  • 1. www.w3professors.com /*** Program to Copy Contents of One File to Another #include <stdio.h> main() { FILE *fp1, *fp2; char ch; fp1 = fopen("abc.txt", "r"); fp2 = fopen("xyz.txt", "w"); while((ch = getc(fp1)) != EOF) putc(ch, fp2); fclose(fp1); fclose(fp2); getch(); } Gursharan Singh Tatla Page No. 1 ***/