Get environment variable: how to use getenv : Environment « Development « C / ANSI-C






Get environment variable: how to use getenv

 Get environment variable: how to use getenv


#include <stdio.h>
#include <stdlib.h>

int main ()
{
  char *p;

  p = getenv ( "PATH" );
  
  if (p != NULL)
    printf ("Current path is: %s", p);
    
  return 0;
}

           
       








Related examples in the same category