#include <iostream>
#include <io.h>
#include <string>
using namespace std;
void dir(string path)
{
long hFile = 0;
struct _finddata_t fileInfo;
string pathName, exdName;
if ((hFile = _findfirst(pathName.assign(path).
append("\\*").c_str(), &fileInfo)) == -1) {
return;
}
do {
if (fileInfo.attrib&_A_SUBDIR) {
string fname = string(fileInfo.name);
if (fname != ".." && fname != ".") {
dir(path + "\\" + fname);
}
} else {
cout << path << "\\" << fileInfo.name << endl;
}
} while (_findnext(hFile, &fileInfo) == 0);
_findclose(hFile);
return;
}
int main()
{
string path="D:\\devSoft";
dir(path);
return 0;
}
如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!
txttool.com 说一段 esp56物联 查询128 IP查询