Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ 3.0r4 - <b>remove</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
remove

Usage

   #include <io.h>
   int remove(const char *filename);

Description

   remove deletes the file specified by the string filename.

Example 

   #include <stdio.h>
   #include <io.h>
   #include <stdlib.h>

   int main()
   {
       int value;
       char buffer[13];
       char *result;

       printf("Input file to remove: ");
       result = gets(buffer);
       value = remove(result);
       if(value == 0)
           printf("Erased [%s] from disk\n",result);
       else {

           printf("Unable to erase [%s]\n",result);
           return EXIT_FAILURE;
       }
       return EXIT_SUCCESS;
   }

Return Value

   Returns 0 if the file was successfully deleted or -1 if an error occurred
   and errno is set.

See Also

   unlink



See Also: unlink

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson