65,211
社区成员
发帖
与我相关
我的任务
分享#define UNICODE
#define _UNICODE
#include <iostream>
#include <tchar.h>
#include <windows.h>
using namespace std;
const TCHAR* pFile1 = _T("D:\\Src\\foo1.txt");
const TCHAR* pFile2 = _T("C:\\Documents and Settings\\foo1.txt");
int main()
{
CopyFile(pFile1, pFile2, FALSE);
return 0;
}
#include <iostream>
#include <tchar.h>
#include <windows.h>
using namespace std;
const TCHAR* pFile1 = _T("D:\\Src\\foo1.txt");
const TCHAR* pFile2 = _T("C:\\Documents and Settings\\foo1.txt");
int main()
{
CopyFile(pFile1, pFile2, FALSE);
return 0;
}
if(0 == CopyFile(pFile1, pFile2, FALSE))
{
printf("Error: %d", GetLastError());
}