char *path = getenv("HOME"); 

printf("path = %s\n",path); 

getenv是标准库函数,包含stdlib.h头文件就可.

posted on 2014-07-21 17:03  步天有术  阅读(945)  评论(0编辑  收藏  举报