gpt4 book ai didi

c++ - 如何获取程序路径

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:08:35 24 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
how to find the location of the executable in C

我正在使用 GTK+ 在 C++ 中编写一个多平台应用程序,但我遇到了问题。我必须得到程序路径。例如,当程序在 /home/user/program(或 C:\Users\user\program.exe)时,我有 /home/user/(或 C:\Users\user\)。

我可以以及如何做到这一点?

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com