Advertisement
Guest User

Untitled

a guest
Jul 5th, 2015
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. ifstream inFile1,inFile2;
  2. char InputFileName1[] = "D:/myfile1.txt";
  3. char InputFileName2[] = "D:/myfile2.txt";
  4. inFile1.open(InputFileName1);
  5. inFile2.open(InputFileName2);
  6.  
  7. if(!inFile1 && !inFile2)
  8. {
  9. cout<<"File not existing in system";
  10. exit(1);
  11. }
  12. string str,str2;
  13.  
  14. while(!inFile1.eof())
  15. {
  16. getline(inFile1,str);
  17. while(!inFile2.eof())
  18. {
  19.  
  20. getline(inFile2,str2);
  21.  
  22. if(str == str2)
  23. {
  24. cout << "Matched Number is " << str2 << endl;
  25. }
  26. else
  27. {
  28. cout<< "Sorry Number not found"<< endl;
  29. }
  30. }
  31. }
  32. inFile1.close();
  33. inFile2.close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement