3C科技 娛樂遊戲 美食旅遊 時尚美妝 親子育兒 生活休閒 金融理財 健康運動 寰宇綜合

Zi 字媒體

2017-07-25T20:27:27+00:00
加入好友
[C/C++基礎] 檔案讀寫防呆標準判斷函數(ferror)使用範例   資料來源: http://www.cplusplus.com/reference/cstdio/ferror/   /* ferror example: writing error */ #include int main () {   FILE * pFile;   pFile=fopen(“myfile.txt”,“r”);   if (pFile==NULL) perror (“Error opening file” );   else {     fputc (‘x’,pFile);     if (ferror (pFile))       printf (“Error Writing to myfile.txt\n” );     fclose (pFile);   }   return 0; }      

本文由jashliaoeuwordpress提供 原文連結

寫了 5860316篇文章,獲得 23313次喜歡
精彩推薦