c++获取当前进程所在位置

char buffer[MAX_PATH];
GetModuleFileNameA(NULL, buffer, MAX_PATH );
string::size_type pos = string( buffer ).find_last_of( "\\/" );
string currentPath = string(buffer).substr( 0, pos);
CHAR fullPath[MAX_PATH];
sprintf(fullPath ,"%s\\%s" ,currentPath.c_str() ,"Demo.exe");

猜你喜欢

转载自www.cnblogs.com/nanfei/p/12071881.html
今日推荐