📜  如何从 ac 程序中找到文件夹 - C 编程语言代码示例

📅  最后修改于: 2022-03-11 15:04:37.929000             🧑  作者: Mango

代码示例1
/*
 * This program displays the names of all files in the current directory.
 */

#include  
#include  

int main(void) {
  DIR *d;
  struct dirent *dir;
  d = opendir(".");
  if (d) {
    while ((dir = readdir(d)) != NULL) {
      printf("%s\n", dir->d_name);
    }
    closedir(d);
  }
  return(0);
}