230 likes | 383 Views
Lect 27P. 2. Winter Quarter. Stream I/O Library Header Files. Note:There is no .h" on standard header files.Be careful about using namespace std"iostream -- contains basic information required for all stream I/O operationsiomanip -- contains information useful for performing formatte
E N D
1. Lect 27 P. 1 Winter Quarter I/O Manipulation Lecture 27
Instructor notes:
Lecture 27 deals with I/O Manipulation, in particular how to have more control over input and output than the basic cin and cout provide. We will look at stream manipulators, format state flags, and I/O stream member functions.
Instructor notes:
Lecture 27 deals with I/O Manipulation, in particular how to have more control over input and output than the basic cin and cout provide. We will look at stream manipulators, format state flags, and I/O stream member functions.
2. Lect 27 P. 2 Winter Quarter Stream I/O Library Header Files Note: There is no .h on standard header files.
Be careful about using namespace std
iostream -- contains basic information required for all stream I/O operations
iomanip -- contains information useful for performing formatted I/O with parameterized stream manipulators
fstream -- contains information for performing file I/O operations
strstream -- contains information for performing in-memory I/O operations (i.e., into or from strings in memory)
Instructor notes:
Since this is starting a new lecture...its probably a good idea to remind people that header files in C++ do not require the .h extension and that to avoid (in an ANSI C++ strict environment) prefixing standard objects with std::, they need to indicate that the standard namespace is being used.
We begin with an overview of the I/O library header files.
iostream is the header file needed for all stream I/O
iomanip lets us control I/O better by making stream manipulators available
fstream lets us do file I/O
strsteam lets us perform operations on strings that are already in memory
Instructor notes:
Since this is starting a new lecture...its probably a good idea to remind people that header files in C++ do not require the .h extension and that to avoid (in an ANSI C++ strict environment) prefixing standard objects with std::, they need to indicate that the standard namespace is being used.
We begin with an overview of the I/O library header files.
iostream is the header file needed for all stream I/O
iomanip lets us control I/O better by making stream manipulators available
fstream lets us do file I/O
strsteam lets us perform operations on strings that are already in memory
3. Lect 27 P. 3 Winter Quarter Classes for Stream I/O in C++ ios is the base class. istream and ostream inherit from ios ifstream inherits from istream (and ios) ofstream inherits from ostream (and ios) iostream inherits from istream and ostream (& ios) fstream inherits from ifstream, iostream, and ofstream