文件IO-rename
rename函数
oldname参数
代码rename
#include <stdio.h>
int main ()
{
int ret;
char oldname[] = "file.txt";
char newname[] = "newfile.txt";
ret = rename(oldname, newname);
if(ret == 0)
{
printf("文件重命名成功");
}
else
{
printf("错误:不能重命名该文件");
}
return(0);
}