Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Borland C++ 2.x ( with Turbo C ) - <b>remove() delete a file</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 remove()                Delete a File

 #include  <stdio.h>

 int remove(my_file);
 const char *my_file;      Name of the file to remove.

        The remove() function deletes a file. The filename may include a
        pathname.

    Returns:    0 on success; on error, returns -1 and sets errno to:
                ENOENT  No such file or directory
                EACCES  Access denied

   -------------------------------- Example ---------------------------------

        This program deletes a file named DATA.DAT.

 #include <stdio.h>

 int main(void)

    char file[80];

    file = "DATA.DAT";
    remove(file);
    return 0;


See Also: unlink()

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