如何使用boost库获取系统环境变量?
我在 Windows 和 MacOS 上工作,我想获取环境变量。 如何使用boost库获取系统环境变量?
是否有相当于 .Net 中的 System.Environment.GetEnvironmentVariable()
?
I work on windows and MacOS, I would like to get environment variables.
How to get system environment variables using boost library?
Are there equivalent to System.Environment.GetEnvironmentVariable()
from .Net ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不需要Boost。使用
中的std::getenv
,这是一个标准 C++ 函数。There's no need for Boost. Use
std::getenv
from<cstdlib>
, which is a standard C++ function.您可能需要一个普通的
c
(和++
)getenv()
函数,不需要提升。You probably want a plain
c
(and++
)getenv()
function, it needs not to be boosted.