If you want to use some system environments, then the getenv(3) system call would be preferede:
Code:
#include <stdlib.h>
char *getenv(const char *name);
If it's something like the current directory, getcwd(3) might be what you're looking for
Code:
#include <unistd.h>
char *getcwd(char *buf, size_t size);
char *get_current_dir_name(void);
char *getwd(char *buf);