Advertisement
TheWhiteFang

Tutorial 11 Q2

Jan 11th, 2015
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. //tutorial 11 q2
  2.  
  3. #include <iostream>
  4. #include <fstream>
  5. #include <string>
  6. using namespace std;
  7.  
  8. int mian(){
  9.  
  10.     fstream copy("Results.txt", ios::in);
  11.     fstream paste("Copy.txt", ios::out);
  12.     string line;
  13.  
  14.     if(copy.is_open()){
  15.    
  16.             while(!copy.eof())
  17.             {
  18.                 getline(copy, line);
  19.                 paste << line <<endl;
  20.            
  21.             }
  22.    
  23.    
  24.     }
  25.     copy.close();
  26.     paste.close();
  27.  
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement