remove file error, using remove() function
<p>I have problem with remove() function</p>

<p>First, look at the example and you will see the problem</p>

<pre><code>cout &lt;&lt; "Please enter the phone number to remove" &lt;&lt; endl &lt;&lt; "Phone number: ";
string rphNumber;
cin &gt;&gt; rphNumber;
ifstream ifile("db/" + rphNumber + ".txt");
if(ifile)
  remove(("db/" + rphNumber + ".txt").c_str()); // the problem here
else
  cout &lt;&lt; "failure" &lt;&lt; endl;
</code></pre>

<p>The problem in this line (the file path), always the function return -1 Although the file exists</p>

<pre><code>remove(("db/" + rphNumber + ".txt").c_str());
</code></pre>
