開發平台(Platform): (Ex: Win10, Linux, ...)
Win10
編譯器(Ex: GCC, clang, VC++...)+目標環境(跟開發平台不同的話需列出)
Dev-C++5.11
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
unistd.h
問題(Question):
chdir在unistd.h裡面是 int chdir(const char *path)
所以我想說能不能在CMD上輸入位址給chdir的引數讀取
因為陣列本身就是指標函數,我想說那不是可以直接依址取值就好了
請教各位大神。
程式碼(Code):(請善用置底文網頁, 記得排版,禁止使用圖檔)
#include <stdio.h>
#include <unistd.h>
int main()
{
char buf[80];
printf("input folder address:");
scanf("%s",&buf);
chdir(*buf);
system("pause");
return 0;
}