I'm trying to write a simple program that will prompt for a string typed in by keyboard and save it to a file. I've tried lots of variations and this is just the latest version. Would appreciate corrections for a total newbie.
//Prompt for a string input by keyboard and save it to a file
using namespace std;
string input = "";
cout << "Input text and press return:\n";
//cout << getline (cin, input);
myfile << getline(cin, input); //error here