C 遍历目录

来自泡泡学习笔记
跳到导航 跳到搜索
#inlcude<io.h>
struct _finddata_t FileList;
long hFile=0;

hFile = _findfirst(path, &FileList);
if(-1 == hFile)
{
    return ;
}

do
{
    //FileList.name
}
while(0 == _findnext(hFile, &FileList));

_findclose(hFile);