Another Deleting File Program Example
Create a new empty Win32 console application project. Give a suitable project name and change the project location if needed.

Then, add the source file and give it a suitable name.
Next, add the following source code.
#include <windows.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
BOOL fSuccess = FALSE;
fSuccess = DeleteFile(TEXT(C:\\testing.txt));
if (!fSuccess)
{
// Handle the error.
printf (DeleteFile() failed, error %d\n, GetLastError());
return (6);
}
else
printf (DeleteFile() is OK!\n);
return (0);
}
Build and run the project. The following screenshot is a sample output.

The Unicode version can be found in the download page.