看板Programming
标 题Re: [问题] 请问fopen的参数
发信站交大资讯次世代BS2 (Thu May 24 01:54:11 2007)
转信站ptt!ctu-reader!ctu-peer!news.nctu!news.cis.nctu!BS2
※ 引述《[email protected] (UBC)》之铭言:
> 在fopen mode那边
来来,都会打字了,原文书也要会看
以下把你引的内容分段,比较容易说明
1> "w" Create an empty file for writing.
2> If a file with the same name already exists its content is erased
> and the file is treated as a new empty file.
3> "w+" Create an empty file for both reading and writing.
4> 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