Hi all, I am writing my first programs to gain a better understanding of environment variables.
So far I have written this - and it compiles with no errors and returns successfully returns a value for the 'PATH'. As seen below:
However, if change 'PATH' to another environment variable as stated on this list: http://en.kioskea.net/contents/syste...ronnement.php3Code:#include <stdlib.h> #include <stdio.h> int main() { char *env = getenv("PATH"); if (env) printf("\nvalue of PATH is: %s\n", env); else printf("\nNULL\n"); return 0; }
such as 'TIME' , then 'NULL' is returned. Basically my question is theory only and I want to know why some environment variables are returned and others are not?. Also I have only a basic understanding of how to use the terminal correctly, so are there commands from the terminal that will show me what environment variables are running?