Functions are the building blocks of C and C++ and the place where all program activity occurs.
The general form of a function is:
The return-type specifies the type of that the function returns. A function returns all type of data except array. The parameter list is a list of variables which is separated with a comma. These variables must have their types associated with them. The parameters of a function are optional.
Even though the parameter list is optional, the parentheses are not optional. The variables in the parameter list must be declared individually.
For example, here is correct and incorrect function parameter list declaration: