How to get system environment variables using boost library?

16.4k views Asked by At

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 ?

2

There are 2 answers

9
Fred Foo On BEST ANSWER

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

0
Michael Krelin - hacker On

You probably want a plain c (and ++) getenv() function, it needs not to be boosted.