语言:C++
编译器:Visual Studio 2017
#include <Windows.h>
#include <string>
#include <cstdlib>
#include <direct.h>
#include <stdio.h>
//获取当前目录
std::string GetPath() {
char buffer[MAX_PATH];
_getcwd(buffer, MAX_PATH);
return buffer;
}
//创建文件夹
std::string NewFolder(const char * _name) {
using namespace std;
string command = "md ";
command += _name;
system(command.c_str());
string path;
path = GetPath();
path += "\\";
path += _name;
return path;
}