[散分]4663马上要升星了,随便出个小问题

snaill 2004-09-29 01:43:36
在MFC中大家都习惯用CStdioFile来处理文本文件,可是为什么CStdioFile不叫CTextFile?

声明,的确是有原因的,不是无聊一问
...全文
332 58 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
58 条回复
切换为时间正序
请发表友善的回复…
发表回复
foolpcman 2004-09-30
  • 打赏
  • 举报
回复
加油!!
pomelowu 2004-09-30
  • 打赏
  • 举报
回复
还没有升?加油啊~~
lxwxiao 2004-09-30
  • 打赏
  • 举报
回复
分来
danielzhu 2004-09-30
  • 打赏
  • 举报
回复
UP
ACuke 2004-09-30
  • 打赏
  • 举报
回复
哈 问题好奇怪 应该你要去问微软
ndhutu 2004-09-30
  • 打赏
  • 举报
回复
接分
zhaogaojian 2004-09-30
  • 打赏
  • 举报
回复

MuseIn 2004-09-30
  • 打赏
  • 举报
回复
好象处理的不止是文本文件,文本只是其中一种罢了。
nb20022 2004-09-30
  • 打赏
  • 举报
回复
up
Red_Baron 2004-09-29
  • 打赏
  • 举报
回复
因为功能决定的吧
zuozl 2004-09-29
  • 打赏
  • 举报
回复
CStdioFile类既可以对文本文件进行操作也可以对二进制文件进行操作,他有Write(),Read()等方法,而不公是WriteString(),ReadString()。
很明显不能叫CTextFile,看名字会认识是专门对文件文件进行访问的。。
Caps77 2004-09-29
  • 打赏
  • 举报
回复
来点分啊,穿5个裤衩的兄弟
mdzhao 2004-09-29
  • 打赏
  • 举报
回复
sweetcrash 2004-09-29
  • 打赏
  • 举报
回复
看MFC source吧,很有帮助
GongXiFaCai 2004-09-29
  • 打赏
  • 举报
回复
A CStdioFile object represents a C run-time stream file as opened by the run-time functionfopen. Stream files are buffered and can be opened in either text mode (the default) or binary mode.

是带缓冲的可以是文本, 也可以二进制

Text mode provides special processing for carriage return–linefeed pairs. When you write a newline character (0x0A) to a text-mode CStdioFile object, the byte pair (0x0D, 0x0A) is sent to the file. When you read, the byte pair (0x0A, 0x0D) is translated to a single 0x0A byte.

对回车符号作了特别处理


The CFile functions Duplicate, LockRange, and UnlockRange are not supported for CStdioFile.

这几个CFILE的函数不支持
adamx 2004-09-29
  • 打赏
  • 举报
回复
YF
名牌大灰狼 2004-09-29
  • 打赏
  • 举报
回复
JF
eesen 2004-09-29
  • 打赏
  • 举报
回复
ding
cngonet 2004-09-29
  • 打赏
  • 举报
回复
同情楼主

还是被-->非技术了

:)
cngonet 2004-09-29
  • 打赏
  • 举报
回复
晕倒,它的baseclass是CFile,而CStdioFile只是用virtural修改了一部分成员,而且如果指定type:binary的时候,它是不会转换回车为那个pair的,。。。。然后加了那俩个输入和读出string的成员而已

这俩个东西我在写程序的时候仔细研究过,做了好多实验和看那说的并不是足够详细的msdn文挡才知道的,对了,还看了mfc的source
加载更多回复(38)

1,658

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 非技术类
社区管理员
  • 非技术类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧