Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int main(int argc, char** argv) {
- ifstream iFile;
- ifstream jFile;
- iFile.open("fileone.txt");
- jFile.open("filetwo.txt");
- int int1 = 0;
- int int2 = 0;
- if (iFile.is_open() && jFile.is_open() ){
- while (iFile.good() || jFile.good() ) {
- iFile >> int1;
- jFile >> int2;
- cout << "From first file:" << int1 << endl;
- cout << "From second file:" << int2 << endl;
- }
- }
- iFile.close();
- jFile.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement