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_P...

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");
沃梦达教程
本文标题为:c++获取当前进程所在位置


基础教程推荐
猜你喜欢
- C语言预编译#define(预处理) 2023-04-03
- 使用VS2022开发在线远程编译部署的C++程序(图文详解) 2023-01-15
- C/C++ Qt StatusBar底部状态栏应用教程 2023-01-10
- C++类和对象到底是什么 2022-11-12
- C语言实现简易停车场管理系统 2023-03-13
- 漫画讲解C语言中最近公共祖先的三种类型 2023-01-01
- 使用C/C++读写.mat文件的方法详解 2023-03-05
- C++高级数据结构之并查集 2023-04-20
- 如何告诉 MinGW 链接器不要导出所有符号? 2022-10-07
- C语言文件操作与相关函数介绍 2023-06-13