I have to do my homework but I can not take path in C.For example ;
int main(void) {
char *path;
path = getenv("PATH");
if(path)
printf("The current path is: %s\n", path);
return 0;
}
If I run this code , I got "Segmentation fault (core dumped)". My os is Ubuntu 14.04 LTS.