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 175 views
1 answer 82 views
3 answers 104 views
2 answers 137 views
1 answer 139 views
...