Windows DatabaseebooksStatistical Information

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


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




//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.


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-2016 Lubby (V3.0.11 Jan 2016)
Sponsored by Keskon.
Datenschutzerklaerung - Privacy statement - Privacyverklaring