hello,
im trying to make something using quotes in a string which is then used by system(d.c_string)
heres the code:
#include <iostream.h>
#include <string>
using namespace std;
int main()
{
string a,b,c,d;
a="del C:\\users\\robocop\\desktop\\\"";
cin >> b;
c="\"";
d=a+b+c;
system(d.c_str());
}
Lets say when running i type 'a b c.txt'
What im trying to get here then is the command
del C:\users\robocop\desktop\"a b c.txt"
But when I run it, it says: "cant find C:\users\robocop\desktop\a"
So apparantly it didnt put the quotes around a b c.txt when string d was used as d.c_str(), because those quotes were for the command line console to read a b c.txt as one filename.
Does anyone know what im doing wrong here? :S