freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

自己制作的c語言教程:第十三章(文件)

2025-06-14 01:20 上一頁面

下一頁面
 

【正文】 正常,返回 c。 char ch,*filename=“”。 ch=getchar()。 putchar(ch)。 char ch,*filename=“”。 fclose(fp)。 scanf(%s,outfile)。 exit(0)。 } ?數(shù)據(jù)塊 I/O:fread與 fwrite ?調(diào)用形式: fread(buffer,size, count,fp) fwrite(buffer,size, count,fp) ?功能:讀 /寫數(shù)據(jù)塊 ?返值:成功,返回讀 /寫的塊數(shù);出錯或文件尾,返回 0 ?說明: ?buffer: 指向要輸入 /輸出數(shù)據(jù)塊的首地址的指針 ?size: 每個要讀 /寫的數(shù)據(jù)塊的大?。ㄗ止?jié)數(shù)) ?count: 要讀 /寫的數(shù)據(jù)塊的個數(shù) ?fp: 要讀 /寫的文件指針 ?fread與 fwrite 一般用于 二進制文件 的輸入 /輸出 例 float f[2]。 for(i=0。 例 struct student { int num。 float score[3]。i++) fread(amp。 int age。 for(i=0。stud[i].age,stud[i].addr)。 int i。iSIZE。 } void display() { FILE *fp。 } for(i=0。 printf(%10s %4d %4d %15s\n,stud[i].name, stud[i].num,stud[i].age,stud[i].addr)。 fp2=fopen(d:\\fengyi\\bkc\\,w)。 fclose(fp1)。 fseek(fp,10L,2)。t open file\n)。i+=2) { fseek(fp,i*sizeof(struct student_type),0)。 } fclose(fp)。 char addr[15]。 long length。 else { fseek(fp,0L,SEEK_END)。 } } 例 求文件長度 () 出錯的檢測 ?ferror函數(shù) ?函數(shù)原型: int ferror(FILE *fp) ?功能:測試文件是否出現(xiàn)錯誤 ?返值:未出錯, 0;出錯,非 0 ?說明 ?每次調(diào)用文件輸入輸出函數(shù),均產(chǎn)生一個新的 ferror函數(shù)值,所以應(yīng)及時測試 ?fopen打開文件時, ferror函數(shù)初值自動置為 0 ?clearerr函數(shù) ?函數(shù)原型: void clearerr(FILE *fp) ?功能:使文件錯誤標(biāo)志置為 0 ?返值:無 ?說明:出錯后,錯誤標(biāo)志一直保留,直到對同一文件調(diào) clearerr(fp)或 rewind或任何其它一個輸入輸出函數(shù) 例 ferror()與 clearerr()舉例 include int main(void) { FILE *stream。 clearerr(stream)。 } 。 fclose(stream)。 getc(stream)。 printf(Length of File is %1d bytes\n,l
點擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1