Write a ‘C’ program to copy content of one file into another file

#include<stdio.h>
#include<conio.h>
void main()
{
FILE *fp1,*fp2;
char ch,fname1[20],fname2[20];
printf("\n enter sourse file name");
gets(fname1);
printf("\n enter sourse file name");
gets(fname2);
fp1=fopen(fname1,"r");
fp2=fopen(fname2,"w");
if(fp1==NULL||fp2==NULL)
{
printf("unable to open");
exit(0);
}
do
{
ch=fgetc(fp1);
fputc(ch,fp2);
}
while(ch!=EOF);
fcloseall();
getch();
}

Comments

  1. plz sent a c ..........
    Program to copy the content of one file to another and count the number of characters,line and words in a above fie

    ReplyDelete
  2. header file must be use to call exit function..and the return type should be int.

    ReplyDelete
  3. this program not be run. for exit(0); in error .

    ReplyDelete
  4. what header file is needed for exit(0) line..??

    ReplyDelete
  5. Please send this PROGRAM TO COPY CONTENTS OF ONE FILE TO ANOTHER FILE AND FIND THE NO OF CHARACTERS AND WORDS IN THE ABOVE FILE

    ReplyDelete
  6. i wana make a program in which data should be store in the file and save it by user and then if he wana to compare the data it should open the data which is save in the file by user .....sir plzzz tell me the program for this thing

    ReplyDelete
  7. create a c program to create text file and display content of the text file

    ReplyDelete
  8. Yes this site is very good for programmer.
    some program are written about file operation using c/c++ language you may follow the link.

    http://www.secufoon.com/category/educational-activity/programming/

    ReplyDelete
  9. Health tips, JSC, PSC, SSC, HSC result, Bank job, job circular, Job news, Educational activity and also Indian visa service- এর যাবতীয় তথ্য পাওয়া যাবে নিচের লিঙ্কে- http://www.secufoon.com

    ReplyDelete
  10. অন্ডথলি কি? অণ্ডথলি ফুলে যাওয়ার কারণ ও তার সমাধান
    Scrotum swelling causes and it’s solution|men’s health problem

    অণ্ডথলি ফুলে যাওয়া হলো অণ্ডথলি অস্বাভাবিক বড় হওয়া। আর অণ্ডথলি হলো এমন একটা থলি যার মধ্যে অণ্ডকোষ থাকে। যেকোনো বয়সী পুরুষের অণ্ডথলি ফুলে যেতে পারে। এর সাথে ব্যথা থাকতে পারে, আবার না-ও থাকতে পারে। এটা অণ্ডথলির এক পাশে অথবা দু’পাশেই হতে পারে। অণ্ডকোষ এবং পুরুষাঙ্গ জড়িত থাকতে পারে, অথবা না-ও থাকতে পারে।

    অণ্ডথলি ফুলে যাওয়ার কারণ-Causes of swelling of the scrotum
    ০ আঘাত Hit/injury
    ০ হার্নিয়া Hernia
    ০ কনজেসটিভ হার্ট ফেইলিওর Congestive heart failure

    আরো জানতে ভিজিট করুন নিচের লিঙ্কে......
    To know details visit this link.

    http://www.secufoon.com/scrotum-swelling-causes-and-its-solutionmens-health-problem/

    ReplyDelete

Post a Comment