Pointer to a null-terminated string containing the name of the file or directory to be deleted.
Read more about parameters of remove in parameters section
The removefunction in C language Deletes a file.
The remove function deletes the file specified by the filename. If the file is currently open, the behavior of the remove function is implementation-defined. This function can also be used to remove empty directories on some systems.
The removefunction takes 1
parameter:
•
const char * `filename`: Pointer to a null-terminated string containing the name of the file or directory to be deleted.
Deletes the file or directory specified by `filename`. If the specified path refers to a directory, the behavior is implementation-defined. Returns `0` on success or a nonzero value on failure, with `errno` set to indicate the error.
The remove function return value :
Returns 0 if the file was successfully deleted, non-zero if an error occurred
Output
This example creates a file, writes to it, closes it, and then deletes it using the remove function.