On this page
  1. remove
  2. Include
  3. Signature & Overview
  4. Notes & Pitfalls
  5. Example

remove

Prev: perror | Up: stdio.h | Next: rename
Rel: stdio.h, stdio.h & File I/O Guide
Ref: cppreference — remove
Tags: #public #prog #c #stdlib #stdio #tier/standard


Include

#include <stdio.h>

Signature & Overview

int remove(const char *path);

Deletes the file (or empty directory) at path; returns 0 on success.

Notes & Pitfalls

Example

#include <assert.h>
#include <stdio.h>

int main(void) {
    assert(remove("definitely_missing_file_xyz") != 0);
}

Linked from

Related notes