I want to open a cmd window that questions (In my language, of course) what name of .txt i want to create, for then put information in it. I have this, but it stills create the txt "Asegurado.txt"
A lot of thanks! But i still have a problem, when I change entrada.open("asegurado.txt", ios::out); to entrada.open(asegurado) i have the following trouble 13 no matching function for call to `std::basic_ofstream<char, std::char_traits<char> >::basic_ofstream(std::string&)'
To use a std::string in the constructor you need to be compiling using a C++11 compliant compiler. Otherwise you'll need to use the c_str() member function to convert the string to a C-string.
1 2
ofstream entrada(asegurado.c_str());
if (!entrada)
Also I recommend just testing the status of the stream instead of using one of the member functions, like fail(), since this tests all the flags.