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

資源簡介

cpp格式 程序源代碼 共424行 理解文件的概念 理解文件存儲的特點

資源截圖

代碼片段和文件信息

/*****************文件管理系統*************************************/
#include
#include//不容易歸類的標準函數庫?
#include
#include
#include
#include//非標準文件輸入輸出操作的代碼符號屬性?
#include
#include

int?init()//初始化操作界面函數?
{
????int?i;
????printf(“**********************\n“);
????printf(“FILE?MANAGE?SYSTEM\n“);
????printf(“**********************\n“);
????printf(“NETWORK033?Cai?Guiquan?NO.1\n“);
????printf(“1-Creat?????File\n“);
????printf(“2-Delete????File\n“);
????printf(“3-OPen??????File\n“);
????printf(“4-Write?????File\n“);
????printf(“5-Locate????File\n“);
????printf(“6-Modify????File\n“);
????printf(“7-Copy??????File\n“);
????printf(“8-Move??????File\n“);
????printf(“9-Cataloge??File\n“);
????printf(“10-Exit?????File\n“);
????printf(“Pleade?Choose:“);
????scanf(“%d“&i);
????return(i);//選擇相應的序號,執行相應的操作?
}

main()
{
??????int?xijflag=1;????
??????char?name[5]name1[15]name2[40];
??????char?choicech;
??????int?handlestatus;//文件定義的指針和狀態
??????FILE?*fp;
??????while(flag)//初始化系統界面?
??????{?
???????????i=init();
???????????getchar();
???????????switch(i){
?????????????????????case?1:label1://創建文本操作?
?????????????????????printf(“Creat?????File\n“);
?????????????????????for(j=0;j<40;j++)
?????????????????????printf(“=“);
?????????????????????printf(“\n\nPlease?input?the?creating?file?name:\n“);
?????????????????????scanf(“%s“name);
?????????????????????getchar();
?????????????????????fp=fopen(name“w+“);//按指定的文件方式創建文件
?????????????????????if(!fp)
?????????????????????{
????????????????????????????printf(“\n?creating?fail“);
????????????????????????????getchar();
????????????????????????????printf(“\nInput?again(Y?or?N)“);
????????????????????????????scanf(“%c“&choice);
????????????????????????????getchar();
????????????????????????????if(choice==‘y‘?||choice==‘Y‘)
????????????????????????????goto?label1;
????????????????????????????}?
?????????????????????else{
??????????????????????????printf(“\nThe?file?is?created“);
??????????????????????????printf(“Do?you?now?input?content?of?the?file?(Y?or?N):“);
??????????????????????????while(1)//輸入創建文件的內容?
??????????????????????????{
????????????????????????????scanf(“%c“&choice);
????????????????????????????if(choice==‘y‘?||choice==‘Y‘?||choice==‘n‘?||choice==‘N‘)??
????????????????????????????break;
????????????????????????????else
????????????????????????????printf(“\nError!Please?input?again!“);???????????????????????????
???????????????????????????}?
??????????????????????????if(choice==‘y‘?||choice==‘Y‘)
??????????????????????????{
???????????????????????????????printf(“\nNow?input?content?to?the?file(End?with‘#‘):\n\n“);
???????????????????????????????fp=fopen(name“w+“);//把內容存放到fp指向的文件中去
???????????????????????????????ch=getchar();
???????????????????????????????while(ch!=‘#‘)
???????????????????????????????{
??????????????????????????????????fputc(chfp);
?????????????

評論

共有 條評論