I am having issues with a very simple notepad program I am building. The bolded line has this issue:
error: no match for 'operator>>' in 'a_file >> file'
int main()
{
string filename;
string file;
string userinput;
string a = a;
string b = b;
cout<<"Would you like to:\n a) Create a new text document or\n b) Open a previous document?\n";
cin>>userinput;
if (userinput==a)
{
cout<<"File name: \n";
cin>>filename;
ofstream a_file (filename.c_str());
cout<<filename<<"is ready for use.\n";
while(getline(cin, file) && file != "quit")
{
a_file<<file<<endl;
}
}
else if (userinput==b);
{
cout<<"File you want to open: \n";
cin>>filename;
ofstream a_file (file.c_str()); a_file>>file;
cout<<file<<endl;
}
cin.get();
}