##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::rename

From cppreference.com
< cpp‎ | io‎ | c

Defined in header `<cstdio>` |  |
int rename( const char *old_filename, const char *new_filename ); |  |

Changes the filename of a file. The file is identified by character string pointed to by `old_filename`. The new filename is identified by character string pointed to by `new_filename`.

### [edit] Parameters

old_filename | - | pointer to a null-terminated string containing the path identifying the file to rename
new_filename | - | pointer to a null-terminated string containing the new path of the file

### [edit] Return value

​0​ upon success or non-zero value on error.

### [edit] Example

| This section is incomplete Reason: no example

### [edit] See also

remove | erases a file (function) [edit]
C documentation for rename

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/io/c/rename&oldid=57821"
Category:

- Todo no example