< Ć]
T
Q
ss
// variables
Function
definition
Pointcn and
E t jrtiplt NlMn
Pointers and Variable
Function definition has a following syntax:
ReturnType FunctionName ( ParameterListopt)
{
DecLaration\Statement List
}
E.g.: Function with a return type double which determines the value of a maximum element in an array:
ftuCHtU ponmtkrij
i double ArrayMax ( int n, double A[ ] )
3
4
5
6
int j;
double max = A[ « j;
for ( j = 1; j < n; ++j )
7
if ( max < A[ j ] )
8
9
return max;
max = A[ j ];
le }
% s
33