Skip to main content

Section 6.7 Passing Streams as Parameters

In the above program, you see that the input and output streams are passed to the file via pass by reference. This fact may at first seem like a surprising choice until you realize that a stream must be changed in order to read from it or write to it. In other words, as streams “flow”, they are changed. For this reason, all streams will always be passed by reference.
You have attempted 1 of 1 activities on this page.