When I compile and run my C++ program that deletes a file called example.txt (below)
#include <stdio.h>
int main ()
{
if( remove( "example.txt" ) != 0 )
perror( "Error deleting file" );
else
puts( "File successfully deleted" );
return 0;
}
It comes out like this...
cd c:\Users\Mark\Desktop
C:\Users\Mark\Desktop>app.exe
Error deleting file: Permission denied
I lifted all restrictions on the file and there is full access to anyone (that should include my program).
Any solutions?
EDIT
When I type in del example.txt
on command prompt it works.
Weird...