listing files in a folder using C in Windows
问题 I want to list the files in this folder "C:\home\WORK\Desktop\Communication". There are ten files in this folder. My code has no error but it's not printing anything. What is my mistake ? #include<stdio.h> #include<Windows.h> #include<string.h> int main(int argc,char *argv[]) { char path[]="C:\\home\\WORK\\Desktop\\Communication"; strcat_s(path,sizeof(path),"\\*"); WIN32_FIND_DATA fdata; HANDLE hFind =INVALID_HANDLE_VALUE; int numberOfFiles=0; char *files[10]; hFind = FindFirstFile(path,