how to invoke a function using a function pointer