displaying files from directory
问题 I have a directory name called dir . It contain following files in order 12.07.2013 13.07.2013 14.07.2013 15.07.2013 16.07.2013 17.07.2013 I wrote following C program to display all the files from the directory dir code : #include <stdio.h> #include <string.h> #include <dirent.h> int main (int argc, char *argv[]) { DIR *directory; struct dirent *file; directory = opendir (argv[1]); if (directory != NULL){ while (file = readdir (directory)) printf("FILE : %s \n",file->d_name); (void) closedir