[Solved] What is an environment vector? [closed]


The “environment” parameter, traditionally named envp, is a zero-terminated array of char*.

You can display it like this:

int main(int argc, char* argv[], char* envp[]) 
{
    while (*envp)
    {
        std::cout << *envp << std::endl;
        envp++;
    }
}

It’s not part of POSIX (or any other standard) but supported by many compilers.

solved What is an environment vector? [closed]