Using the code below, I tried to implement a second line of code to delete another file in the same folder. I got an error message as a result.
I'm using messenger as an example:
I tried to replecate this line:
const char * pFileToDelete = "h:\\MSN Messenger\\myfile.txt";
into something like
const char * pFileToDelete = "h:\\MSN Messenger\\myfile2.txt";
No result...
How do I list another file into the equation?
Thank you
#include <iostream>
#include <windows.h>
int main(int argc, const char * argv[])
{
// Get a pointer to the file name/path
const char * pFileToDelete = "h:\\MSN Messenger\\myfile.txt";
// try deleting it using DeleteFile
if(DeleteFile(pFileToDelete ))
{
// succeeded
std::cout << "Deleted file" << std::endl;
}
else
{
// failed
std::cout << "ERROR! " << std::endl;
}
std::cin.get();
return 0;
}