This preview shows page 1. Sign up to view the full content.
Unformatted text preview: fstream, ofstream (and fstream).
ofstream (and fstream
Instances of these classes. C++ provides a mechanism for a hierarchy of
classes where each level of the hierarchy inherits
behaviours from its ancestors in the family tree.
This process is called inheritance.
It is the foundation of object-oriented
programming using C++.
We'll introduce inheritance later. But they're not the ones.
Applied Programming For now, we only need to know that there are two
stream classes providing the base for our known
stream Applied Programming W hat is more important is that the two operators
<< and >> are just operators defined for streams.
<< and >>
That is, they are just functions.
For example, in ostream we have
ostream They are
istream for input
ostream for output ostream& operator<<(const type&); W e can now see that the functions such as
cin.get(), cin.eof() and cout.put()...
View Full Document
- Spring '14