COSC-051 Lecture 11: Lecture 11

84 views2 pages

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.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents