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++ Language Reference - unlink http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   unlink

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

   Description
   unlink deletes the file specified by the string filename.

   Example
   #include <stdio.h>
   #include <io.h>
   #include <stdlib.h>
   main()
   {
   int value;
   char buffer[13];
   char *result;

        printf("Input file to remove: ");
        result = gets(buffer);
        value = unlink(result);

        if(value == 0)
             printf("Erased [%s] from disk\n",result);
        else
             printf("Unable to erase [%s]\n",result);
   }

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


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