How to get the OS path environment list in C++

1 Answer

0 votes
#include <iostream>
#include <cstdlib>
 
int main()
{
    if (const char* env_p = std::getenv("PATH"))
        std::cout << env_p;
}



/*
run:

/usr/local/sbin:...

*/

 



answered Jun 27, 2020 by avibootz

Related questions

1 answer 195 views
3 answers 260 views
1 answer 232 views
1 answer 258 views
258 views asked Jan 13, 2017 by avibootz
...