Once you define a
pointer to a function, you must assign it to a function
address before you can use it. Just as the address of an array arr[10] is
produced by the array name without the brackets (arr), the address of a
function func() is produced by the function name without the argument
list (func). You can also use the more explicit syntax
&func(). To call the function, you dereference
the pointer in the same way that you declared it (remember that C and C++ always
try to make definitions look the same as the way they are used). The following
example shows how a pointer to a function is defined and used:
After the pointer to function fp
is defined, it is assigned to the address of a function func() using
fp = func (notice the argument list is missing on the function name). The
second case shows simultaneous definition and initialization.