Hi,
again, I am a newbie to the programming and I need your help!
Well, I am just trying to learn the language for my hobby and free time.
But I need to get help to this....
I tried the Remove command like:
for Delete32.cpp:
_________________________________
// remove example: remove myfile.txt//
#include <stdafx.h>
int main ()
{
if( remove( "myfile.txt" ) == -1 )
perror( "error deleting file" );
else
puts( "File successfully deleted" );
return 0;
}
_______________________________________
and this, I used remove command (or I think)
to delete myfile.txt within the SAME directory
to where Delete32.cpp is located but,
how do i make it so that the remove command
will delete something OUTSIDE of the directory
which Delete32.exe resides
So now, I am trying to delete
"test" in the "C:\" Driver or "C:\test"
and that will delete anything inside of that...
Thank you for any help!
Keehun

How to remove files
Smithy196
Chris Han MSFT
thank YOU
Delphyne
Hi,
I don't think I fully understand your question. But I'll just give it a shot.
Try using a statement like this remove("..\myfile.txt") I think this will remove files outside of your own directory. Or you could just specify the whole path to be more accurate...
BTW, im moving your post in the C++ area. To avoid confusions...
cheers,
Paul June A. Domag
mon
Thanks, and I understand your answer
but can you be more specific
Because I don't fully understand it...
well, I'll give my shot too.
To you mean something like this
#include <stdafx.h>
int main ()
{
if( remove( "../myfile.txt" ) == -1 )
perror( "error deleting file" );
else
puts( "File successfully deleted" );
return 0;
}
or is it possible to:
#include <stdafx.h>
int main ()
{
if( remove( "c:\test\" ) == -1 )
perror( "error deleting file" );
else
puts( "File successfully deleted" );
return 0;
}
well, THANKS!!!
themuuj