Home arrow C++ arrow Introduction to Streams

Introduction to Streams

C++, unlike C, has the kinds of services and additions that, at the beginning at least, seem like evil dinosaurs meant to make your life harder and to complicate simple problems. However, once you get the hang of them, youíll realize the opportunities that they give you, and you wonít ever want to use the older C methods for the same purpose again. Streams are one of these wicked dinosaurs.

Author Info:
By: Gabor Bernat
Rating: 5 stars5 stars5 stars5 stars5 stars / 8
March 17, 2009
  1. · Introduction to Streams
  2. · Abstract Representation
  3. · How Should They Look?
  4. · Conclusion

print this article

Introduction to Streams
(Page 1 of 4 )

This article is an introduction to my multi-part series that will unveil all of the secrets of streams in C++ and help you get the most benefit from minimal effort. All ten parts will appear here on the Developer Shed network, so stay close and watch out for them.

In this first article Iíll present streams at an abstract level, and explain the purpose for which they were created. Questions like how they should work in general, what convention should be followed so that a class can be called a stream, or why and where to use them wonít be forgotten either.

For this particular article, no object-oriented programming knowledge is required, but if you intend to understand the rest of this series, such knowledge will be mandatory. If you lack these basic ideas in C++ I advise you to first get a good grasp of how classes work, how can they be used, and also what polymorphism represents in the world of codes inside C++.

Taken from the dictionary.com definition, a stream is ďa continuous flow or succession of anything: a stream of words.Ē And of course this fits exactly what a stream wants to be in C++; also, a stream of words can be translated to a stream of ones and zeros if we talk in the language of machines.

Most of the time, streams are used to assure a good and secure flow of data between an application and files. This is why most people simplify them to Input/output streams. However, this is wrong, because streams can be used for many internal procedures within an application as well, as youíll see during this series. But before we rush further into this subject, letís consider streams at an abstract level.

blog comments powered by Disqus

- Intel Threading Building Blocks
- Threading Building Blocks with C++
- Video Memory Programming in Text Mode
- More Tricks to Gain Speed in Programming Con...
- Easy and Efficient Programming for Contests
- Preparing For Programming Contests
- Programming Contests: Why Bother?
- Polymorphism in C++
- Overview of Virtual Functions
- Inheritance in C++
- Extending the Basic Streams in C++
- Using Stringstreams in C++
- Custom Stream Manipulation in C++
- General Stream Manipulation in C++
- Serialize Your Class into Streams in C++

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials