C > Gnu-Linux
Show,access enviroment var's
Show,access enviroment var's #ifndef __USE_GNU #define _GNU_SOURCE #endif #include
#include
#include
int main(void) { char **env = environ; char pwd[256] = {0}; printf("getenv() says, go home: %s\n", getenv("HOME")); getcwd(pwd, sizeof(pwd)); printf("getcwd says, no I am staying here: %s\n", pwd); printf("All other enviroment var's .... \n"); for(; *env; env++) printf("%s\n", *env); return 0; }
C Codes
Beginners
C on Unix
Code Snippets
Data Structures
File Operations
Games Graphics
Gnu-Linux
Hardware
Mathematics
Miscellaneous
Small Programs
Sorting