[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
CppStream
You can ?overload the stream in operator and overload the stream out operator.
Also, you can manipulate streams.
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
CppStream
(C++) Streams
Stream Classes
A ?stream is a general name given to a flow of data. A stream is represented by an object of a particular class. Different streams are used to represent different kinds of data flow.Advantages of Streams
C programmers may wonder what advantages there are to using the stream classes for i/o instead of traditional C functions such as printf() and scanf() and, for files, fprintf() and fscanf() and so on. There are no formatting special characters like %d and %f in streams since each object already knows how to display itself. In C++, streams are the best to write data to files and also to format data in memory for later use in text i/o windows and other GUI elements.Stream Class Hierachy
The extraction operator >> is a ?member of the ?std::istream class and the insertion operator << is a member of the ?std::ostream class. Both of these classes are derived from the ios class. The std::cout object representing the standard output stream, which is usually directed to the video display, is a predefined object of the ostream_withassign class, which is derived from the ostream class. Similarly, std::cin is an object of the istream_with assign class which is ?derived from ?std::istream.You can ?overload the stream in operator and overload the stream out operator.
Also, you can manipulate streams.
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
