This is a bit hard to explain, and i'm not even sure this is possible in C++, but here it goes.
Imagine I have a class "Level" for a tetris game. One function in this class is called "CheckLines" and it checks if there are any lines in the level and then removes them.
In the main program I have another function, "onLineFound", which, for example, plays a sound effect and adds 10 point to the score.
Now everytime "CheckLines" finds a line, I want it to call "onLineFound", but I do not want "onLineFound" to be part of the "Level" class (because the class is platform independent and playing a sound is not).
Note that I could solve this particular example in other ways, but I'm looking for the method, not the solution