📅  最后修改于: 2022-03-11 14:44:47.345000             🧑  作者: Mango
#include
#include
using namespace std;
int main()
{
char oldname[] = "file_old.txt";
char newname[] = "file_new.txt";
/* Deletes the file if exists */
if (rename(oldname, newname) != 0)
perror("Error renaming file");
else
cout << "File renamed successfully";
return 0;
}