I/O Streams -- Other Features


eof() member function


Character I/O

Character Output


Character Input


Making input more type safe

You've probably noticed that if a user attempts to enter words where a number is expected on an input statement, things get messed up. How do we handle this?  

Useful character functions (library cctype)

The C library called cctype contains many useful character functions. They are not specifically geared towards I/O -- they are just useful for working with characters.

Here's a quick description of some of the useful functions. See the chart on page 247 of the textbook for more details and examples.
All of these functions take a single character as a parameter -- assume that ch is a char:



Passing Stream Objects into Functions

Inheritance and Streams