C++
  Home arrow C++ arrow Introduction to Streams
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
C++

Introduction to Streams
By: Gabor Bernat
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 3
    2009-03-17

    Table of Contents:
  • Introduction to Streams
  • Abstract Representation
  • How Should They Look?
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Introduction to Streams


    (Page 1 of 4 )

    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.

    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.

    More C++ Articles
    More By Gabor Bernat


     

    C++ ARTICLES

    - 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++
    - Advanced File Handling with Streams in C++
    - File Handling and Streams in C++
    - The STL String Class







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek