(C++) std::getenv

February 24, 2017 · View on GitHub

 

 

 

 

 

(C++) std::getenv

 

std::getenv is an STL function to obtain an environmental variable.

 


#include <cstdlib> #include <iostream> #include <string> int main() {   const std::string s = std::getenv("PATH");   std::cout << s << '\n'; }