Windows DatabaseebooksStatistical Information

LLE10234 : Howto get the PATH environment variable setting via a c or c++ program

Symptom:

You are writing a c/c++ program and want to get some environment variable

Cause:

none

Solution:

//To get to the environment variables you can use the following program and compile it:

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

int main(void) {
  char *myenvvar=getenv("PATH");
  printf("The PATH environment variable is set to %s\n",myenvvar);
}


//compile with: gcc envvar.c -o envvar
//stand for environment variable
//Wim Peeters.
 


Disclaimer:

The information provided in this document is intended for your information only. Lubby makes no claims to the validity of this information. Use of this information is at own risk!
Copyright © 2004-2011 Lubby (V3.0.10 Aug 2011)
Sponsored by Keskon.
Statistical information by Google Analytics