Wisdom Materials
Home
About Us
Our Clients
Careers
Services
Education
Jobs
News
Business
Health
Astrology
Entertainment
RealEstate
Devotion
Contact Us
C Programs
/ Copy one file to Other C Program
Program
Click to the Copy Program
#include
#include
#include
void main() { FILE *ff,*sf; char ch; sf = fopen("abcd1.txt","r"); if(ff==NULL) { puts("File Does not exist."); exit(0); } ft = fopen("abcd2.txt","w"); if (ft==NULL) { puts("File Does not exist."); exit(0); } while(1) { ch=fgetc(sf); if (ch==EOF) break; else fputc(ch,sf); } fclose(ff); fclose(sf); }
Input
File1 and File2
Output
Copy Contents of abcd1.txt to abcd2.txt
Home
Back