Skip over navigation

Functions in C++

Terms

Introduction and Summary

Functions

Return Type  -  The kind of value a function will send back to the line of code that called it. A variable of matching type can be set to the return value of a function. Functions which do not return a value have return type void.
Declaration  -  A declaration is a line of code that states the data type and name of a function or a variable, without necessarily assigning a procedure or value to it.
Definition  -  A definition is a declaration that attaches meaning to the item being declared. A variable definition assigns a value to the variable, a function definition assigns the code of the function to the function name, and a class definition declares all components of the class.
Inline  -  A function which the compiler will essentially "cut and paste" wherever the function is used. To make a function inline, use the inline keyword.
Overloading  -  The process of creating different versions of a function based on differing return types or arguments. The different versions of a function must be distinguishable from one another by the compiler. In practice this means that either the return type or the number or type of the arguments must differ between versions.
Function Template  -  A function template is a function definition that does not require a specified return type or argument types. Instead, the function can accept and return any data type.

Follow Us