linux C 獲取當前的工做目錄

#include <stdio.h> #include <string.h> #include <unistd.h> int main(void) { char buffer[1024] ; //獲取當前的工做目錄,注意:長度必須大於工做目錄的長度加一 char *p = getcwd(buffer , 40); char *dir = NULL; printf("buffer:
相關文章
相關標籤/搜索