Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ifstream inFile1,inFile2;
- char InputFileName1[] = "D:/myfile1.txt";
- char InputFileName2[] = "D:/myfile2.txt";
- inFile1.open(InputFileName1);
- inFile2.open(InputFileName2);
- if(!inFile1 && !inFile2)
- {
- cout<<"File not existing in system";
- exit(1);
- }
- string str,str2;
- while(!inFile1.eof())
- {
- getline(inFile1,str);
- while(!inFile2.eof())
- {
- getline(inFile2,str2);
- if(str == str2)
- {
- cout << "Matched Number is " << str2 << endl;
- }
- else
- {
- cout<< "Sorry Number not found"<< endl;
- }
- }
- }
- inFile1.close();
- inFile2.close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement