上网查了很多,各说纷纭。
直接上代码
#include <string>
#include <direct.h>
int main()
{
std::string strSrcFile = "F:\\dir1\\";
std::string strDesFile = "d:\\dir2\\";
_mkdir(strDesFile.c_str());
std::string strCommand = "copy " + strSrcFile + " " + strDesFile;
system(strCommand.c_str());
return 0;
}
一定要双右斜