http://baike.baidu.com/view/1186290.htm?fr=aladdin
使用io.h中的_findfirst,_findnext,_findclose,_finddata_t。
1 #include <io.h> 2 #include <stdio.h> 3 4 int main() 5 { 6 long Handle; 7 struct _finddata_t FileInfo; 8 9 if((Handle=_findfirst("*.*",&FileInfo))==-1L) 10 printf("Not found! "); 11 else 12 { 13 printf("%s ",FileInfo.name); 14 while(_findnext(Handle,&FileInfo)==0) 15 printf("%s ",FileInfo.name); 16 _findclose(Handle); 17 } 18 return 0; 19 }