c++如何将文件复制到其他地方

来源:互联网 发布:害羞知乎 编辑:程序博客网 时间:2024/06/03 05:19

                                                                                        c++如何将文件复制到其他地方

              最近,我在写应用程序,要用到的是将一个目录下的文件复制到其他文件里去,就发出来看看吧,

// ConsoleApplication3.cpp : 定义控制台应用程序的入口点。
//

#include "stdafx.h"
#include <string>
#include<windows.h>
#include<iostream>
#include <stdio.h>
#include<cstring>
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
 CopyFile(L"C:\\Users\\Jin\\Desktop\\新建文本文档.txt", L"C:\\Users\\Jin\\Desktop\\新建文本文档23.txt", TRUE);

 return 0;
}

//copyfile函数的前面一个参数是原文件的路径,后一个参数是目的路径,最后那个就不用管了


0 0