You need to escape your string. . .
string x = "C:\\Users\\dino\\Documents\\profiles\\fil.txt";
문제
I have made this very simpel program and all it needs to do is deleting a file
#include <string>
#include <iostream>
#include <fstream>
int main()
{
string x = "C:\Users\dino\Documents\profiles\fil.txt";
if(remove(x.c_str()) != 0)
{
perror("Error deleting ");
}
return 0;
}
But the perror gives me Invalid argument
Can't i choose the directory of the file I want to delete? if not, is there another way i can?
해결책
You need to escape your string. . .
string x = "C:\\Users\\dino\\Documents\\profiles\\fil.txt";