Hello. I've been doing some programming recently that is supposed to delete files from a specified pathway
#include <iostream>
#include <cstdlib>
#include <windows.h>
using namespace std;
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow);
int main()
{
cout <<"Deleting file...";
// ??? What to do here?
MessageBox(NULL, "File Deleted!", "Alert!", NULL);
return 0;
}
As indicated above, I don't really know how to introduce the delete function here. I would like to delete a file from a certain pathway on the computer, e.g.
("C:\Program Files\filedel.txt"); How would I run this, so it can locate the file itself, witout the aid of running the program in the same folder or location to insure it's deleted anyway.
Thank you, help is appreciated!