C/Development/Environment
Get environment variable: how to use getenv
<source lang="cpp">
- include <stdio.h>
- include <stdlib.h>
int main () {
char *p; p = getenv ( "PATH" ); if (p != NULL) printf ("Current path is: %s", p); return 0;
}
</source>
<source lang="cpp">
int main () {
char *p; p = getenv ( "PATH" ); if (p != NULL) printf ("Current path is: %s", p); return 0;
}
</source>