#include <io.h>
#include <iostream>
#include <vector>
using namespace std;
void getFiles(string path, vector<string>& files){
intptr_t hFile = 0;
struct _finddata_t fileinfo;
string p;
if ((hFile = _findfirst(p.assign(path).append("\\*").c_str(), &fileinfo)) != -1)
{
do
{
if ((fileinfo.attrib & _A_SUBDIR))
{
if (strcmp(fileinfo.name, ".") != 0 && strcmp(fileinfo.name, "..") != 0)
getFiles(p.assign(path).append("\\").append(fileinfo.name), files);
}
else
{
files.push_back(p.assign(path).append("\\").append(fileinfo.name));
}
} while (_findnext(hFile, &fileinfo) == 0);
_findclose(hFile);
}
}
int main(){
string FilePath = "E:\\Graduation project\\codev2\\Group Gset\\data";
vector<string> FileName_List;
getFiles(FilePath, FileName_List);
for (int i = 0; i < FileName_List.size(); i++) cout << FileName_List[i].c_str() << endl;
}