Advertisement
Guest User

Untitled

a guest
Sep 20th, 2014
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4.  
  5. int main(int argc, char** argv) {
  6.  
  7. ifstream iFile;
  8. ifstream jFile;
  9. iFile.open("fileone.txt");
  10. jFile.open("filetwo.txt");
  11.  
  12. int int1 = 0;
  13. int int2 = 0;
  14. if (iFile.is_open() && jFile.is_open() ){
  15.  
  16.  
  17. while (iFile.good() || jFile.good() ) {
  18.  
  19. iFile >> int1;
  20. jFile >> int2;
  21.  
  22. cout << "From first file:" << int1 << endl;
  23. cout << "From second file:" << int2 << endl;
  24.  
  25. }
  26. }
  27.  
  28. iFile.close();
  29. jFile.close();
  30.  
  31. return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement