In: Computer Science
If you have any doubts, please give me comment...
// Language: C++
#include<iostream>
#include<fstream>
#include<string>
using namespace std;
int main(){
string filename, line;
cout<<"Enter filename: ";
getline(cin, filename);
ofstream outFile;
outFile.open(filename.c_str());
cout<<"Enter line of text: "<<endl;
getline(cin, line);
outFile<<line<<endl;
outFile.close();
cout<<"Successfully line saved into "<<filename<<endl;
return 0;
}