c++特定文件夹搜索文件

emmm
最好是整个程序啊

include system.h ,调用一下dir命令就行了。
dir /s d:\abc\1*.txt
搜索D盘abc下文件名以1开头的txt文件。追问

#include
using namespace std;
int main()
{
dir /s d:\abc\1*.txt;
return 0;
}
这样?

追答

dir /s d:\abc\1*.txt;
改成
system(dir /s d:\abc\1*.txt);

试试。好多年不写C,没有IDE测试了。

温馨提示:答案为网友推荐,仅供参考
相似回答