Linux下获取用户主目录的方法分享

char *path = getenv("HOME"); 

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

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

相关文章
相关标签/搜索