Home Segments Index Top Previous Next

126: Mainline

Because parameters are just variables that happen to be initialized by argument values, you can change the value of any parameter using an assignment statement. For example, you could amend the box_car_volume function as follows:

double box_car_volume (double h, double w, double l) { 
  l = h * w * l; 
  return l; 
} 

Using l as a name for the volume is bad programming practice, however, because such use leaves l with more than one meaning.