R. Clayton (rclayton@monmouth.edu)
(no date)
One technique that may be helpful in solving assignment 5a is passing io-stream
variables (such as std::cout and std::cerr) as procedure parameters. To do
that, you need to know the type of such variables. Nyhoff isn't too helpful on
this point, and, to be fair, there are a fairly complicated set of concepts
involved in answering that question.
However, good old Deitel and Deitel have examples of what you need to do; see
Figures 11.19, 14.14, and 14.15 (in increasing order of complexity). If you're
interested in what's going on, see Sections 11.1 through 11.5 and 14.3. Make
sure you pay careful attention to the examples and follow them closely; failure
to do so usually results in obscure program errors with obvious consequences.
In addition, I've been using this technique in almost every single assignment
that's needed to do stream I-O. See my solutions to assignments 1b, 2a, and 2b
for examples.
This archive was generated by hypermail 2.0b3 on Mon Dec 15 2003 - 19:45:06 EST