创建文件目录C++ windows
#include <iostream>#include <Windows.h>int main(){
char file[] = "E:\\C1\\ch";bool flag = CreateDirectory(file,NULL);
DWORD err = GetLastError();std::cout<<"flag: "<<flag<<std::endl;
std::cout<<"err: "<<err<<std::endl;
return 0;
}
这段代码编译时出现错误:cannot convert parameter 1 from 'char [15]' to 'LPCWSTR;
解决办法,Alt+F7;
问题解决!