vc下c语言列出指定文件

来源:互联网 发布:linux system 阻塞 编辑:程序博客网 时间:2024/05/04 18:05
#include <stdio.h>#include <windows.h>int main(){ char   chPath[256]; WIN32_FIND_DATA wfd; HANDLE   h; printf("Enter the path:\n"); gets(chPath); h = FindFirstFile(strcat(chPath, "\\*"), &wfd); if (h != INVALID_HANDLE_VALUE) {  do   {   printf("%s\n", wfd.cFileName);  } while (FindNextFile(h, &wfd)); } else {  printf("Path error!\n"); } return 0;}
原创粉丝点击