使用
char path[200];
if(!getcwd(path,200)){
cout<<"Get path fail!"<<endl;
return 0;
}
cout<<"path:"<<path<<endl;
open配合
file.open("/mnt/c/Users/zhifeiyu/Documents/0学习课件/大三上学习课件/程序设计/script_interpreter/dev/a.txt",ios::in);
//当前目录下有a.txt
浙公网安备 33010602011771号