42 พอยร์เตอร์เรียกฟังก์ชั่น ( pointer to function )


  • void (*ptr)(void); // คือ pointer to function.
  • void *ptr(void); // คือการประกาศฟังก์ชั่น คืนค่า pointer of void.
  • การประกาศ pointer to function ต้องใส่วงเล็บรอบชื่อกับ * ทุกครั้ง เพราะ ( ) มีศักดิ์เครื่องหมายสูงกว่า *
  • http://en.wikipedia.org/wiki/Callback_(computer_programming)




No comments:

Post a Comment