Next:
Argument passing
Up:
Basic C++
Previous:
Loops
Contents
Functions
function declaration:
typeName functionName
(
typeName1 argName1
, ...
);
double performSum(double op1, double op2);
function call:
varName
=
functionName(
argName1
, ...
) ;
double d = performSum(1.0, 2.1);
return control to calling code:
return
value
;
double performSum(double op1, double op2) {
return op1 + op2;
}
Subsections
Argument passing
Overloading
Leo Liberti 2008-01-12