我正在寻找一种方法来读取目录路径中的所有txt文件,而无需在C编程中扩展它们。
到目前为止我的代码:
DIR *dr = opendir("Adding Customer");
struct dirent *de; // Pointer for directory entry
// opendir() returns a pointer of DIR type.
// for readdir()
while ((de = readdir(dr)) != NULL)
printf("%s\n", de->d_name);
closedir(dr);
printf("===================================================\n\n");
printf("Press Any key to go back");
getch();
mainmenu();