StudyLover
  • Home
  • Study Zone
  • Profiles
  • Contact us
  • Sign in
StudyLover 23. Program to read content from one file and write it to another file.
Download
  1. C++ Programs list
22. Program to read and write binary data in a file. : 24. Program to count the number of lines, words, and characters in a file.
C++ Programs list

1.      Program to read content from one file and write it to another file.

  1. #include <iostream.h>

  2. #include <fstream.h>

  3. #include<conio.h>

  4. int main() {

  5.     ifstream fin("input.txt");

  6.     ofstream fout("output.txt");

  7.  

  8.     char ch;

  9.     cout<<"content of 'input.txt' file is: \n";

  10.     while (fin.get(ch)) {

  11.                 fout << ch;

  12.                 cout<<ch;

  13.     }

  14.     cout<<endl;

  15.     fin.close();

  16.     fout.close();

  17.  

  18.     cout << "File copied successfully!" << endl;

  19.     getch();

  20.     return 0;

  21. }

  22.  

22. Program to read and write binary data in a file. 24. Program to count the number of lines, words, and characters in a file.
Our Products & Services
  • Home
Connect with us
  • Contact us
  • +91 82955 87844
  • Rk6yadav@gmail.com

StudyLover - About us

The Best knowledge for Best people.

Copyright © StudyLover
Powered by Odoo - Create a free website