Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char** getFilesName(int* arg)
- {
- char** names;
- *arg = 0;
- names = (char**)calloc(50, sizeof(char*));
- for(int i = 0; i < 50; i++)
- names[i] = (char*)calloc(50, sizeof(char));
- WIN32_FIND_DATA winFileData;
- HANDLE hFile;
- char szPath[MAX_PATH];
- if(GetCurrentDirectory(sizeof(szPath), szPath))
- {
- lstrcat(szPath,"\\db\\*.db*");
- hFile = FindFirstFile(szPath,&winFileData);
- if (hFile!=INVALID_HANDLE_VALUE)
- {
- do
- {
- strcpy(names[*arg], winFileData.cFileName);
- *arg += 1;
- }
- while (FindNextFile(hFile, &winFileData)!=0);
- FindClose(hFile);
- }
- }
- return names;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement