example about funtion pointer and switch statement