COSC-051 Lecture 11: Lecture 11
Document Summary
Bala does not want us to use these; he forbids . Values that are passed automatically if arguments are missing from a function call. Must be a constant or literal declared in the prototypee or header (whichever occurs first) void evenorodd(int x = 0); Multi-parameter functions may have default arguments for some or all parameters int getsum(int, int=0, int=0); ^^ in this case this is a prototype. If not all parameters to a function have default values, the ones without defaults must be declared first in the parameter list. When an argument is omitted from a function call, all arguments after it must also be omitted. Allows a function to work with the original argument from the function call, not a copy of the argument. Allows the function to modify values stored in the calling environment. Provides a way for the function to return" more than 1 value.