System Error C++ : <p>So I'm making a script to make a txt file and put data on it, but when I run the system(); function, I get a strange error.  Here's the code.</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;fstream&gt;
#include &lt;stdlib.h&gt;
using namespace std;

int main()
{
    string textFileName = "SavedPasswords.txt";
    string currentPassword = "Pas123!()";
    string currentName = "Home";
    string seperator = "====================";

    ofstream textFile(textFileName.c_str());

    textFile &lt;&lt; "N: " &lt;&lt; currentName &lt;&lt; endl &lt;&lt; "P: " &lt;&lt; currentPassword &lt;&lt; endl &lt;&lt; endl &lt;&lt; seperator &lt;&lt; endl;

    string directory;
    size_t path = textFileName.rfind("\\");

    if(string::npos != path)
    {
        directory = textFileName.substr(0, path);
    }

    string systemCommands[3] = {"cd\\",
    "cd " + directory,
    "start " + textFileName};

    system(systemCommands[0]);
    system(systemCommands[1]);
    system(systemCommands[2]);
}
</code></pre>

<p>C:\Users\User\Desktop\SavePasswords\main.cpp|29|error: cannot convert 'std::string {aka std::basic_string}' to 'const char*' for argument '1' to 'int system(const char*)'|</p>

<p>I get the same error for the next two lines.</p>
