CMPSC 16 Lecture Notes - Lecture 7: Function Prototype, Return Type
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.