Search code examples
c++boostplatform-independent

How to get system environment variables using boost library?


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 ?


Solution

  • There's no need for Boost. Use std::getenv from <cstdlib>, which is a standard C++ function.