#include #include #include int main() { const char* path ="./*"; struct dirent **namelist; int n = scandir(path, &namelist, NULL, alphasort); if (n < 0) { perror("scandir"); return 1; } for(int i=0;id_name); free(namelist[i]); } free(namelist); return 0; }