Delete a file from code

C, C++, Visual C++, C++.Net Topics
Post Reply
Jane
Corporal
Corporal
Posts: 10
Joined: Sun Jul 19, 2009 9:19 pm

Delete a file from code

Post by Jane » Sun Jul 19, 2009 9:46 pm

Hi,

Is it possible to delete a file from C++ without using Win API function.

Thanks

Jane
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: Delete a file from code

Post by Neo » Tue Jul 21, 2009 3:24 pm

int remove ( const char * filename );

If the file is successfully deleted, a zero value is returned.
On failure, a nonzero value is reurned and the errno variable is set to the corresponding error code.
Post Reply

Return to “C/C++ Programming”