next up previous contents
Next: What is a parameter? Up: Subroutines Previous: How to turn it   Contents


Parameter Passing for Subroutines

In the previous chapter, we discussed subroutines in general. We discovered that we can use subroutines to share and reuse code in a program. We also discovered a limitation: we have to rely on global variables to let the code invoking the subroutine communicate with the invoked subroutine.

This chapter presents the concept of ``parameters''. Parameters is a powerful concept that allows a clean, elegant and flexible linkage between a subroutine and the code that invokes it.



Subsections

Tak Auyeung 2003-12-03