新手,刚学习多线程,想要实现这样一个功能,请问有推荐的书籍或技术博客吗?还有这个功能大概要怎么实现?
2条回答 默认 最新
- guo_jd 2017-08-01 06:40关注
可以用io.h这个库
#include
#include
#includeusing 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 { cout << fileInfo.name << (fileInfo.attrib&_A_SUBDIR? "[folder]":"[file]") << endl; } while (_findnext(hFile, &fileInfo) == 0); _findclose(hFile); return;
}
int main()
{
string path="G:\testdir";
dir(path);
return 0;
}解决 无用评论 打赏 举报