在linux系统纯c环境中:
#include <stdio.h> //加载头文件
int rename(const char *oldname, const char *newname); //函数声明
举例使用:
test.cpp、test.txt与home文件夹放在同一目录下,那么如果想通过test.cpp将test.txt放入home文件夹,
则:: rename("test.txt",“home//test.txt");
在linux系统纯c环境中:
#include <stdio.h> //加载头文件
int rename(const char *oldname, const char *newname); //函数声明
举例使用:
test.cpp、test.txt与home文件夹放在同一目录下,那么如果想通过test.cpp将test.txt放入home文件夹,
则:: rename("test.txt",“home//test.txt");