特牛网址导航

C++ 获取程序运行路径_c++获取程序运行路径-CSDN博客

网友收藏
文章浏览阅读1.2k次。#if WIN32#include <windows.h>std::string getAppDirPath() { char buffer[MAX_PATH]; GetModuleFileName(NULL, buffer, MAX_PATH); *strrchr(buffer, '\\') = 0; return buffer;}#else#include <unistd.h>#include <string.h>#include &l._c++获取程序运行路径