
AI
int GetList(const char *path); // 获取某路径下所有文件
int mAIn(int argc, char *argv[]){ char *cwd;

etc
return 0;}
int GetList(const char *path){ DIR *dir; struct dirent *ptr; if( (dir=opendir(path))==NULL ) { perror(opendir error); return -1; }
while( (ptr=readdir(dir))!=NULL ) { printf(ptr.name = %s\n, ptr-d_name); } closedir(dir);
return 0;}
Copyright © 2025 IZhiDa.com All Rights Reserved.
知答 版权所有 粤ICP备2023042255号