I have come to understand that char **envp
is the third argument to main
, and with the help of the code below, I was able to see what it actually c
env
allows you to access the environment variables. It contains an array of strings. Examples are the users home directory, the configured language scheme, the PATH variable (where to look for directly executable programs?), ...
You can also set individual environment variables. For example, if you have testing (learning) and also a production system you deploy your application to. On one system you could set the variable "MY_APP_MODE=TEST" and on the other system you could specify "MY_APP_MODE=PROD". So you don't need to deploy different applications to the test and production systems. Your application could determine itself in what environment it is run.