Next: Function Body, Up: Example: Recursive Fibonacci [Contents][Index]
In our example, the first two lines of the function definition are the header. Its purpose is to state the function’s name and say how it is called:
int fib (int n)
says that the function returns an integer (type int
), its name is
fib
, and it takes one argument named n
which is also an
integer. (Data types will be explained later, in Primitive Data Types.)