91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 3.34KB
    文件類型: .zip
    金幣: 1
    下載: 0 次
    發布日期: 2021-02-21
  • 語言: C/C++
  • 標簽:

資源簡介

C++實戰源碼-遍歷磁盤目錄(入門級實例193).zip

資源截圖

代碼片段和文件信息

//?ListDir.cpp?:?Defines?the?entry?point?for?the?console?application.
//

#include?“stdafx.h“
#include?
#include?
#include?

const?int?MAXLEN?=?1024; //定義最大目錄長度
unsigned?long?FILECOUNT?=?0; //記錄文件數量

void?ListDir(const?char*?pchData)
{
_finddata_t???fdata;??? //定義文件查找結構對象
long???done;????
char?tempdir[MAXLEN]={0}; //定義一個臨時字符數組,存儲目錄
strcat(tempdir?pchData); //連接字符串
strcat(tempdir?“\\*.*“); //連接字符串
done???=??_findfirst(tempdir?&fdata);???//開始查找文件
if?(done?!=?-1) //是否查找成功
{
int?ret?=?0;
while??(ret?!=?-1)????? //定義一個循環
{
if?(fdata.attrib?!=?_A_SUBDIR) //判斷文件屬性
{
if?(strcmp(fdata.name“...“)?!=?0?&&
strcmp(fdata.name“..“)?!=?0?&&
strcmp(fdata.name“.“)?!=?0) //過濾.
{
char?dir[MAXLEN]={0}; //定義字符數組
strcat(dirpchData); //連接字符串
strcat(dir“\\“); //連接字符串
strcat(dirfdata.name); //連接字符串
cout?< FILECOUNT++;

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????2055??2010-10-12?14:38??ListDir\ListDir.cpp
?????文件????????4548??2010-10-12?14:37??ListDir\ListDir.dsp
?????文件?????????539??2010-10-12?14:37??ListDir\ListDir.dsw
?????文件?????????294??2010-10-12?14:37??ListDir\StdAfx.cpp
?????文件?????????769??2010-10-12?14:37??ListDir\StdAfx.h

評論

共有 條評論