I just have a question regarding structures. I have commented the source accordingly. Cheers.
Code:#include<dirent.h> #include<stdio.h> int main(void) { DIR *d; struct dirent *dir; //How are these structures defined when there isn't a stucture set? d = opendir("."); // and why is dir a pointer? if (d) { while ((dir = readdir(d)) != NULL) { printf("%s\n", dir->d_name); } } closedir(d); getchar(); return 0; }