Re: [問題] 請問fopen的參數

看板Programming作者時間18年前 (2007/05/24 02:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/2 (看更多)
※ 引述《UBC.bbs@ptt.cc (UBC)》之銘言: > 在fopen mode那邊 來來,都會打字了,原文書也要會看 以下把你引的內容分段,比較容易說明 > "w" Create an empty file for writing. > If a file with the same name already exists its content is erased > and the file is treated as a new empty file. > "w+" Create an empty file for both reading and writing. > If a file with the same name already exists its content is erased > and the file is treated as a new empty file. 有沒有注意到2和4的部份完全一樣? 既然你預期 w 和 w+ 會有差別, 那麼完全一樣的部份,就叫「廢話」,不用看。 > +代表可讀 不是很了解"讀"的意思 你會用fscanf(), fgets(), fread()這些函數吧? 不然至少會fscanf()吧? > 那麼w+是指在這次處理中 可讀寫嗎 到fclose()以前都是。   -- Opinions : 彼得謝勒的生與死 (2004) : http://blog.bs2.to/post/GOLDMEMBER/9086 美國戰後戰鬥機發展時程,F-80 - XF-108 : http://blog.bs2.to/post/GOLDMEMBER/8981 The UNIVAC Biblestory : http://blog.bs2.to/post/GOLDMEMBER/9041 The James Bond Superweaponry : http://blog.bs2.to/post/GOLDMEMBER/9002 今日的一言(2/10): 登月演說, 1962 : http://blog.bs2.to/post/GOLDMEMBER/7840 http://blog.bs2.to/GOLDMEMBER 法外科學暨工程顧問公司 -- ▄▄▄▄▄▄▄ ▄▄▄▄ ▄▄▄▄▄▄ <telnet://bbs.cs.nctu.edu.tw> █▄▄▄▄█ █ ▄▄▄▄▄█ Player: GOLDMEMBER ▄█▄▄▄▄█ ▄▄▄█ █▄▄▄▄▄ From: 218-160-85-245.dynamic.hine ☆ 次世代BS2 ☆ 可申請個人板 150MB 相簿 http://pic.bs2.to 交大資訊人 250MB
文章代碼(AID): #16L85a00 (Programming)
文章代碼(AID): #16L85a00 (Programming)