Question: in C++ and follow this template: #include #include #include using namespace std; int main() { string word; char init; cin >> word >> init; word+=.txt;

in C++ and follow this template: #include #include #include using namespace std; int main() { string word; char init; cin >> word >> init; word+=".txt"; ifstream myFile(word); myFile.open(word); string dataOut; if (myFile.is_open()){ cout << "hehe"; while (getline(myFile, dataOut)){ cout << dataOut << endl; } } else { cout << "unable to open the file"; } myFile.close(); return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Law Questions!