CISC 1600 Lecture Notes - Lecture 16: Function Prototype, Return Type, Semicolon

85 views2 pages

Document Summary

A function has a lists of statements and a function header. A function header has 3 parts: return type, name and parameter list. The difference between a return type of int and a return type of void is that int returns an integer and void does not return any value. A parameter holds a value being passed as an argument into a function. The example above is empty, but you can put int x insides the parenthesis and that makes the parameter x. In order to use (call) a function in function main, the function has to be either declared (function prototype) or placed before the main function. Function call: functionname (2, 3); (* notice, prototype has a semicolon at the end) For example, the one on the left place the main function below the printface function. The one on the right demonstrates the use of function prototype.

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