Code:#include <stdio.h> #include <conio.h> #include <dir.h> int main() { int done; struct ffblk a; clrscr(); done = findfirst("c://TCWIN45//INCLUDE//*.h",&a,0); while(!done) { printf("%s\t",a.ff_name); done = findnext(&a); } getch(); return 0; }
Code:#include <stdio.h> #include <conio.h> #include <dir.h> int main() { int done; struct ffblk a; clrscr(); done = findfirst("c://TCWIN45//INCLUDE//*.h",&a,0); while(!done) { printf("%s\t",a.ff_name); done = findnext(&a); } getch(); return 0; }
More "borrowed" code, huh?
How about answering this question yourself. Does this program display a list of all header files in the given directory? (I'm assuming you tried to run it.)
Excepting the obsolete compiler and OS.
You might see some weird crap as soon as it sees a path component which doesn't match 8.3 notation, or spaces in the filename, or dates past Y2K, or a host of other issues.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.