c++获取运行路径

来源:互联网 发布:java二分法查找 编辑:程序博客网 时间:2024/06/05 05:52
//获得程序路径
char aFilePath[MAX_PATH + 1] = { 0 };
GetModuleFileNameA(NULL, aFilePath, MAX_PATH);


string sReturn = "";
sReturn.append(aFilePath);
int nFindLast = sReturn.find_last_of("\\");
sReturn = sReturn.substr(0, nFindLast + 1);


string dataFile = sReturn + gDataFile;
0 0
原创粉丝点击