資源簡介
文件目錄管理與顯示 給出樹形文件目錄和文件信息,要求編程實現將其排列成一棵有一定縮進的樹形目錄。 基本要求: (1)設計文件和目錄信息樹的存儲結構。 (2)從文件或鍵盤輸入目錄和文件信息,輸入格式采用絕對路徑法。 (3)設計有層次帶縮進的樹形目錄和文件輸出格式。 (4)設計從目錄樹中查找指定目錄或文
代碼片段和文件信息
#include
#include
using?namespace?std;
struct?creat_time
{
int?year;
int?month;
int?date;
};
struct?info
{
bool?flag;??//0?不可訪問?1?可訪問
bool?cf;?//0?目錄?1?文件
char?name[20];??//文件名
char?filetype[10];??//文件類型
creat_time?time;??//創建時間
info*parent*firstchild*brother;//?指針
int?n;??//包含文件數
int?cenci;
int?size;?
};
info*root*U;//root?不變?U?可變
class?content
{
public:
content(){root=NULL;}
void?rootcreat();
void?creat(info*);
int?Delete(info*);
void?DELETE(info*);
void?unfold(info*);
info*locate(info*);
void?traverser(info*);
};
void?nodeshow(info*q)
{
if(q)
{
cout<name;
if(q->cf)cout<<‘.‘<filetype;
}
}//nodeshow?end
/*int?Strcmp(char*cchar*ch)
{int?i=0;
while(c[i]!=‘\0‘)
{
if(c[i]!=ch[i])return?0;
i++;
}//if(ch[i])return?0;
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2019-07-05?08:45??文件管理與顯示\
?????文件????????5805??2019-07-04?21:39??文件管理與顯示\文件管理與顯示.cpp
?????文件??????199561??2019-07-05?08:45??文件管理與顯示\文件管理與顯示.docx
?????文件?????1929359??2019-07-04?21:39??文件管理與顯示\文件管理與顯示.exe
評論
共有 條評論