C++之文件操作移动、复制、重命名

1
C++笔记之CopyFile和MoveFile的使用

2 删除和重命名

#include <fstream>
#include <windows.h>		//与opencv的命名空间CV有冲突,不能在一个文件中使用

int main()
{
    string path="H://test";//测试路径
    remove("H://test/a.txt");//删除文件
    rename("H://test/b.txt","H://test/c.txt");//将b.txt重命名为c.txt
 
    return 0;
 }

3 文件夹新建:C++ 创建文件夹的四种方式

4 文件是否存在:C/C++中判断某一文件或目录是否存在

猜你喜欢

转载自blog.csdn.net/kevinshift/article/details/88832112