資料結構 檔案編輯系統

2021-09-23 14:36:04 字數 1453 閱讀 9359

#include #include #include #include typedef struct line

line;

void create(line * &head)

if(ch[0]==5)break; /*如果發現輸入 ^e,則退出輸入*/

p=p->next=new line;

p->data=new char[strlen(ch)+1]; /*為結點分配空間 */

strcpy(p->data,ch);

if(ch[strlen(ch)-1]==5) /*除去最後乙個控制符 ^e */

}p->next=null; /*最後的乙個指標為空 */

head=head->next;

}/**文字字數統計**/

int count_space(line* &head)//統計空格數

while((p=p->next)!=null);

return count;

}int count_num(line * &head)//統計數字個數

while((p=p->next)!=null);

return count;

}int count_all_word(line * &head)//統計文章的總字數

while((p=p->next)!=null);

return count;

}int count_letter(line * &head)//統計字母數

while((p=p->next)!=null);

return count;

}int find_word(line * &head,char *sch)//統計 sch 在文章**現的次數

}} }while((p=p->next)!=null);

return count;

}/**特定字串的刪除**/

void del_string_word(char *s,char *sch)

while((p=p->next)!=null);

}/**列印輸入的文字**/

void outputtxt(line * &head)//向螢幕輸出文章

while((p=p->next)!=null);

}void count(line * &head)

void main()

else if(strcmp(id,"2")==0)

else if(strcmp(id,"3")==0)

else if(strcmp(id,"4")==0)

else if(strcmp(id,"5")==0)

else if(strcmp(id,"6")==0)

else

}}}

Linux檔案系統資料結構

linux的每個檔案包含3個資訊 檔名 inode 儲存檔案的元資料資訊 datablock 儲存檔案真正的內容資料 linux的檔案管理空間有兩個部分 元空間 儲存檔名 inode 資料空間 datablock 元資料和資料的區別表專案 元資料資料 概念檔案的描述資訊 檔案內真正儲存的資料內容 容...

檔案系統 檔案系統中的資料結構

0.參考 1.檔案系統的主要資料結構 2.超級塊及其操作函式 3.inode及其操作函式 4.目錄項資料結構定義及操作函式 5.檔案結構體的定義及檔案的操作函式 推薦ups主 善不外來名不虛傳 linux核心設計與實現 第二版,第三版 內容摘選自 檔案系統1 檔案系統2 雜湊鍊錶 以上感恩 檔案系統...

編輯器資料結構

data structures for text sequences 這篇文章給出了實現乙個文字編輯器所需要的的資料結構和不同結構的效率。文章指出有六種資料結構可以實現編輯器,分別是linked list,array,gap,line spans,piece tables和fixed size bu...