as

Thursday, 13 November 2014

Deleting File in C

We can delete the file using remove method.


#include<stdio.h>

void main()
{
   int ret;

     // remove method accepts the name of file to be deleted as a parameter
   ret=remove("c:\\abc.txt");

  if(ret==0)
   {
    printf("File is deleted \n");
   }
  else
   {
    printf("File not deleted \n");
   }

getchar();

}







Sponsored Links

Popular Posts

Comments

ShareThis

Google+ Followers

Google+ Badge