How to get system environment variables using boost library?

Arman picture Arman · Jan 13, 2012 · Viewed 13.1k times · Source

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 ?

Answer

Fred Foo picture Fred Foo · Jan 13, 2012

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