c++ callback for events

amanpoonia's Avatar, Join Date: Dec 2011
Newbie Member
how can we implement callback..
Suppose we have two classes student and display and we will call display only when the marks of students have changed using function pointers.
we can increase number of student .we can add marks for particular student keeping it in while loop
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Moved to C++ forum
xpi0t0s's Avatar, Join Date: Aug 2004
One of the aims of OOP is to eliminate the need for unsafe practices like calling function pointers. Do the design properly and you won't need to use function pointers for this - you can just call the display routine on a change, using the display object directly.