Call back function is exactly what the name suggests a function that you "call back" after you've done your work. Think of it as passing a function pointer that you have to execute after the initial function has finished executing. Example:
- Code: Select all
//work is done send the result to a function that will handle it
It's used in multi-threading application, it doesn't make much sense in single thread apps. MyFunction might contain a loop that runs every 5 seconds, so it never returns to the caller, but it's "sending" the results it generated to another function that process them (and is running in another thread).