Interview answers verified by specialists.

Find interview questions and answers on this website:


See right interview answers on 30 common job interview questions

How do you view the PATH?

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 <stdio.h>
#include <stdlib.h>
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);
}

Do you know that?

biggest challenge for 41.8% freelancers is to find clients Next

Articles:

Popular:

Fast Payments
Payoneer sing up to get free 
$25