remove() - I/O Function

How is remove() used in C++?


remove() is an I/O function which is used to remove a file directly without using streams. When a file is successfully deleted, a zero value is returned otherwise a nonzero value is returned. The corresponding errno variable is set to the corresponding error code.


int remove ( const char * filename );

Example :

#include <stdio.h>
int main ()
return 0;

In the above example the rewind() is used to read the information printed into a file by moving the pointer to start of the stream.

C++ Tutorial

Ask Questions

Ask Question