how can i delet a file in a path that i have in a variable ?

September 11, 2015 at 11:11:34
Specs: Windows 10, 6 gb
i made two C++ programs that gets me a game file path in any pc so...i want to put/delete a file from it but i just can get the path in a variable but i can't do any thing with it .
i tryed : system("del variable");
but it didn't work and : system("del "variable);
also didn't work so i need a way to delet or paste a file with out the "system" way so peas any one have an answer pleas get sure that it works before publishing it .
the answers in C++ pleas :)

See More: how can i delet a file in a path that i have in a variable ?

Report •


#1
September 11, 2015 at 12:39:07
That 'system("del")' implies Windows. The Win32 function for that is DeleteFile().

How To Ask Questions The Smart Way


Report •

#2
September 11, 2015 at 13:26:54
i tryed that i entered the variable but it didn't work

string path = "c:\\games\\game.exe";

DeleteFlile(path);

didn't work :/

it says that the function don't accept string , But how could i get the file in that path deleted if it won't accept string ?


Report •

#3
Report •
Related Solutions


Ask Question