CMPSC 16 Lecture Notes - Lecture 7: Function Prototype, Return Type

35 views2 pages
21 Oct 2016
School
Course
Professor

Document Summary

A type cast produces a value of none type from another: static_cast(identifier) 2 components of function definition: function declaration (function prototype) Shows how the function is called from main() or other functions. Must appear in code before the function can be called. // comment describing what function does: function definition. Describes how the function does its task. Can appear before or after the function is called. Declares: return type, name of function, how many arguments are needed, types of the arguments, the formal parameter names. Tells the name of the function to use. Is used in a statement where the returned value makes sense. Two forms for function declaration: list formal parameter names. Aids the description of the function in comments: list types of formal parameters, but not their names. Black box abstraction (cid:862)(cid:271)la(cid:272)k (cid:271)o(cid:454)(cid:863) refers to something we know how to use, but the method of its internal operation is unknown.

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