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
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.