流到底是个什么概念?

Dnight 2004-10-29 01:26:29
C++里的"流"是个什么概念啊,一直没理解清楚?
...全文
190 15 打赏 收藏 转发到动态 举报
写回复
用AI写文章
15 条回复
切换为时间正序
请发表友善的回复…
发表回复
张志龙 2004-10-29
  • 打赏
  • 举报
回复
Dnight(Dnight),不知道。可能说法上的区别吧。以前还没有流这个概念。
celeil 2004-10-29
  • 打赏
  • 举报
回复
“流”应该说是一个形象的比喻,比喻数据的传输就像水流一样流动,所以有“数据流”这个说法。输入\输出流,那就顾名思义啦:)
Dnight 2004-10-29
  • 打赏
  • 举报
回复
.........................
输出操作将一个对象转换为一个字符序列,输出到某一个地方;输入操作从某一个地方接受字符序列。输入输出操作可以看成是字符序列在源和目的之间的对象流动。所以叫流类
...........................
那字符序列又是什么,
流的输出和printf输出有什么区别呢
hzr_hope 2004-10-29
  • 打赏
  • 举报
回复
你可以把它想成是水!水流是由水分子组成,字符流是由字符组成!它们都可能从一个地方流到另一个地方!
张志龙 2004-10-29
  • 打赏
  • 举报
回复
输出操作将一个对象转换为一个字符序列,输出到某一个地方;输入操作从某一个地方接受字符序列。输入输出操作可以看成是字符序列在源和目的之间的对象流动。所以叫流类
xuzheng318 2004-10-29
  • 打赏
  • 举报
回复
不是经常听到输入输出流嘛! 就是所谓的流!
cin,cout
古侠 2004-10-29
  • 打赏
  • 举报
回复
我也不知道
carylin 2004-10-29
  • 打赏
  • 举报
回复
其实就是输入输出操作,包括文件的读写
ScorpioCool 2004-10-29
  • 打赏
  • 举报
回复
C++ 中的“流”就是指那些可以放在一串 operator << 最左边的东西
luckysym 2004-10-29
  • 打赏
  • 举报
回复
块表示可以对数据“随机操作”
luckysym 2004-10-29
  • 打赏
  • 举报
回复
流就是“顺序操作”
cqulzg 2004-10-29
  • 打赏
  • 举报
回复
我也正在寻思这个问题呀
  • 打赏
  • 举报
回复
iostream:in out stream(输入输出流)
Dnight 2004-10-29
  • 打赏
  • 举报
回复
e文不行啊~~
看不出个所以然啊`~
悔恨中~
xMars 2004-10-29
  • 打赏
  • 举报
回复
What A Stream Is
Like C, C++ does not have built-in input/output capability. All C++ compilers, however, come bundled with a systematic, object-oriented I/O package, known as the iostream classes. The “stream” is the central concept of the iostream classes. You can think of a stream object as a “smart file” that acts as a source and destination for bytes. A stream’s characteristics are determined by its class and by customized insertion and extraction operators.

Through device drivers, the disk operating system deals with the keyboard, screen, printer, and communication ports as extended files. The iostream classes interact with these extended files. Built-in classes support reading from and writing to memory with syntax identical to that for disk I/O, which makes it easy to derive stream classes.

64,642

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

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