11.07.2015 Views

tYSR20

tYSR20

tYSR20

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 24Using Stream I/OIn This Chapter Performing input/output Rediscovering stream I/O as an overloaded operator Using stream file I/O Using stream buffer I/O Going behind the scenes with manipulatorsPrograms appearing before this chapter read from the cin input objectand output through the cout output object. Perhaps you haven’t reallythought about it much, but this input/output technique is a subset of what isknown as stream I/O.In this chapter, I describe stream I/O in more detail. I must warn you thatstream I/O is too large a topic to be covered completely in a single chapter —entire books are devoted to this one topic. Fortunately for both of us, thereisn’t all that much that you need to know about stream I/O in order to writethe vast majority of programs.How Stream I/O WorksStream I/O is based on overloaded versions of operator>>() andoperator(istream& source, char *pDest);istream& operator>>(istream& source, int &dest);istream& operator>>(istream& source, char &dest);

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!