Computer Science Canada Function pointers by example |
Author: | Martin [ Thu Jun 08, 2006 3:14 am ] | ||
Post subject: | Function pointers by example | ||
Function pointers are a powerful feature of C++.
|
Author: | wtd [ Thu Jun 08, 2006 9:12 am ] | ||
Post subject: | |||
Actually. function pointers are a feature of C. C++ has an even better way to do this. Templates, type inference, and function objects. ![]()
|
Author: | avok23 [ Sun May 04, 2008 3:49 am ] |
Post subject: | RE:Function pointers by example |
i have been using c++ for a good while and still havent found a reason to use this. i hear its usefull in ai. |
Author: | wtd [ Sun May 04, 2008 11:20 am ] |
Post subject: | RE:Function pointers by example |
Think about callbacks. |
Author: | Saad [ Sun May 04, 2008 11:24 am ] |
Post subject: | |
wtd @ Thu Jun 08, 2006 9:12 am wrote: Actually. function pointers are a feature of C. C++ has an even better way to do this. Templates, type inference, and function objects.
![]() I never knew about this. This way seems much better and easier then funtion pointers. Thanks! |
Author: | Narlayusin [ Wed Mar 22, 2017 4:27 am ] |
Post subject: | RE:Function pointers by example |
It is the information that should be told to everyone really. |
Author: | ThomasWown [ Sat Mar 25, 2017 1:11 am ] |
Post subject: | RE:Function pointers by example |
@Martin - 100% Agreed! This is useful because functions encapsulate behavior. For instance, every time you need a particular behavior such as drawing a line, instead of writing out a bunch of code, all you need to do is call the function. |