Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

C programming/stdio.h/remove

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

remove is a function in C programming language that removes a certain file. It is included in the C standard library header file stdio.h. The prototype of the function is as follows: int remove ( const char * filename ); If successful, the function returns zero. Nonzero value is returned on failure and errno variable is set to corresponding error code. Sample usage The following program demonstrates common usage of remove: #include <stdio.h> int main() { const char *filename = "a.txt"; remove (filename); return 0; } To implement a simple remove utility: #include <stdio.h> int main(char* argv[], int argc) { if (argc > 1) { return remove (argv[1]); }else{ return -1; } } External links C++ reference for std::remove deep