Hello guys, I need help, I want to write the results of the cin to the fie but it always rewrites the file, how do I just make it open the file if it's already there if not it will ask the user to make that file
#include <iostream>
#include <fstream>
#include <string>
usingnamespace std;
int main()
{
ofstream myfile;
string Product;
Product = "NONE";
cout << "Hello, we are Say-Pear, what would you like to see in our store? \n";
cout << "Please use the underscore _ for spaces: \n";
cin >> Product;
myfile.open ("Products.txt");
myfile << Product;
myfile.close();
}