How do you view the PATH? Ans. Your C compiler library contains a function called getenv() that can retrieve any specified environment variable. It has one argument, which is a pointer to a string containing the environment variable you want to retrieve. It returns a pointer to the desired environment string on successful completion. If the function cannot find your environment variable, it returns NULL. The following example program shows how to obtain the PATH environment variable and print it on-screen: #include #include void main(void); void main(void) { char* env_string; env_string = getenv('PATH'); if (env_string == (char*) NULL) printf('\nYou have no PATH!\n'); else printf('\nYour PATH is: %s\n', env_string); } - Study24x7
Social learning Network
13 Apr 2023 01:01 PM study24x7 study24x7

How do you view the PATH? Ans. Your C compiler library contains a function called getenv() that can retrieve any specified environment variable. It has one argument, which is a pointer to a string containing the environment variable you want to retrieve. It returns a pointer to ...

See more

study24x7
Write a comment
Related Questions
500+   more Questions to answer
Most Related Articles