C++如何用system命令获取文件夹下所有文件名

http://www.cplusplus.com/reference/cstdlib/system/

http://bbs.csdn.net/topics/30068943

 

#include <stdlib.h>

查找当前路径下文件名,并存入tmp.txt。

system("dir > tmp.txt");

查找绝对路径c:\folder下文件名,并存入tmp.txt。

system("dir c:\\folder>tmp.txt");

posted on 2014-07-28 15:41  浩然119  阅读(643)  评论(0编辑  收藏  举报