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
Get step-by-step solutions from verified subject matter experts
