C++
  Home arrow C++ arrow Page 4 - 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 - Conclusion


    (Page 4 of 4 )

    Another motivation for using the streams instead of the old stdio library is that there is a good chance that this improves readability and performance. Despite the fact that these are also streams, we won’t cover them; instead, we will focus on the more stylish usage of the iostream class family.

    In conclusion the definition taken from the MSDN library sums up all that we have said until now: “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.”

    C usually associates three file descriptors with an application: stdin (standard input), stdout (standard output), stderr (standard error). Despite the fact that these are mapped to devices like the keyboard and monitor, they are represented in files, showing that C was designed initially for UNIX, where every input/output is treated as a file. The iostream classes (where all the streams are defined) are an object-oriented I/O alternative to the C run-time functions.

    The older file input/output has been replaced by the stream classes, as I’ll also cover in a future article. Generally speaking, it is a good idea to use streams every time you can, instead of the old C library, which is still active and usable under the C++ language.

    And now the bell rings and we suspend this class on insights into streams for today, but you can freely ask your questions in the blog comments that follow the article -- or join our friendly ever-growing forums over at DevHardware and enjoy the full benefits of being a regular member. Until we meet again (remember to keep your eyes open since the entire series will be published here!) take care and… “Live with Passion!”


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

     

    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 3 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek