COSC-051 Lecture 1: Lecture 10

61 views2 pages

Document Summary

Function definition: int main() cout << hello world\n ; return 0; Line 1: int is the return type. main is the function name. The parentheses ( ) indicate a parameter list. In the case that there is nothing in between the parentheses, the parameter list is empty. The prototypee must include the data type of each parameter in its (). The header must include a declaration, with variable type and name, for each parameter in its () The call for the above function would look like this: evenorodd(val) *note: no data type on argument in call* The value of the argument is copied into the parameter when the function is called. There must be a data type listed in the prototype () and an argument declaration in the function heading () for each parameter. Arguments will be promoted/demoted as necessary to match parameters.

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

Related Questions