I am trying to write a program that ask the user for a file name and then it opens that file. When I compile it I get the following error:
no matching function for call to std::basic_ofstream<char,
std::char_traits<char> >::basic_ofstream(std::string&)
This is my code:
using namespace std;
int main()
{
string asegurado;
cout << "Nombre a agregar: ";
cin >> asegurado;
ofstream entrada(asegurado,"");
if (entrada.fail())
{
cout << "El archivo no se creo correctamente" << endl;
}
}