linux C 获取当前目录的实现:标签:当前目录,MAX,FILEPATH,getcwd,获取,file,linux,path,include From: https://blog.51cto.com/yetaotao/5796928
//获取当前目录
#include
#include
#include
#include
//包含了Linux C 中的函数getcwd()
#define FILEPATH_MAX (80)
int main(){
char
*file_path_getcwd;
file_path_getcwd=(char *)malloc(FILEPATH_MAX);
getcwd(file_path_getcwd,FILEPATH_MAX);
printf("%s",file_path_getcwd);
}