working on c++ function pointer