Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int main()
- {
- char choice;
- string line,line1;
- cout << "Is this the correct file?(Y/N)" << endl;
- cout << "Y = Yes" << endl;
- cout << "N = No" << endl;
- cin >> choice;
- switch(choice){
- case 'Y' :
- case 'y' :
- ifstream mask, SUV;
- mask.open("mask_test_file1.txt");
- SUV.open("suv_test_file1.txt");
- if(mask.is_open()){
- while (getline(mask,line))
- {
- cout <<line<<'\n';
- }
- }
- if(SUV.is_open()){
- while(getline(SUV,line1)){
- cout << " " << endl;
- cout << line1 <<'\n';
- }
- }
- mask.close();
- SUV.close();
- cout << "File loaded" << endl;
- break;
- }
- switch(choice){
- case 'N' :
- case 'n' :
- cout << "Incorrect file loaded" << endl;
- break;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement