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 ?
On the Windows taskbar, right-click the Windows icon and select System. In the Settings window, under Related Settings, click Advanced system settings. On the Advanced tab, click Environment Variables. Click New to create a new environment variable.
Machine environment variables are stored or retrieved from the following registry location: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment . Process environment variables are generated dynamically every time a user logs in to the device and are restricted to a single process.
Boost is a set of libraries for the C++ programming language that provides support for tasks and structures such as linear algebra, pseudorandom number generation, multithreading, image processing, regular expressions, and unit testing. It contains 164 individual libraries (as of version 1.76).
There's no need for Boost. Use std::getenv
from <cstdlib>
, which is a standard C++ function.
You probably want a plain c
(and ++
) getenv()
function, it needs not to be boosted.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With