My question was answered within the first 40 seconds of the video, "What is a callback function?" Answer: "A callback function is a function that is passed to another function as an argument." Good Stuff!
Hey, thanks for your input. Please keep in mind that the video is about implementing callback functions in C while you are talking about C++. C doesn't support lambda expressions.
I am clearing my own mind. Just correct me if I am wrong : "Using compar as the way it is defined (i.e. int compar (const void *p1, const void* p2); allows a custom comparison function even for objects derived from a class via type casting in compar function same as the way you have done by casting those void* pointers to int* pointer. " If I understood above correctly, I think I have understood the utility of call back functions correctly. Please verify my understanding and oblige.
Because different callback functions can be called from a single "main" function. By providing the callback function as an argument to a "main" function, the code is more generic since only this "main" function is needed to call different callback functions within it. The alternative would be to have multiple different "main" functions that each call their hardcoded callback function. This creates code duplication.
My question was answered within the first 40 seconds of the video, "What is a callback function?" Answer: "A callback function is a function that is passed to another function as an argument." Good Stuff!
Clear and straight to the point. Thanks.
You explained it well .it is very good and easy to understand.
Thank You for going more in depth in your example using qsort. Look forward to your "C" videos!
I really liked the content. At these days it is very hard to find a deeply and simply videos. Thanks
very informative.
that type of deep knowledge content we need.
please make more of these types of videos.
Wow, I understand everything you explained in the video so easily! Thank you very much!
This video is great, You cleared my concept of callback and function pointer, Thanks a lot
Best Callback Explanation Ever! Thanks my friend, GBY!
Very good explanation and sample of function pointer
Easy to understand. We can directly call the callback function just like a normal routine. Why we made them function pointer?
int main(){
add(5,5):
}
найс инглиш, мой славянский друг )
Great tutorial!
That’s was such a good explanation, thanks!!
Awesome video. Thank you for the explanation! :)
Hey, thanks for your input.
Please keep in mind that the video is about implementing callback functions in C while you are talking about C++. C doesn't support lambda expressions.
Thank for this video, really helped me.
Short and precise description 👍👍👍
Nice explanation.
Plz add more vdos on this topic like sending struct pointer and many more.🙏🙏
Very good.
Great explanation !!
Thank you very much. Very precise and to the point.
I have a question. Is it possible to implement asynchronous callback functions in C?
I am clearing my own mind. Just correct me if I am wrong :
"Using compar as the way it is defined (i.e. int compar (const void *p1, const void* p2); allows a custom comparison function even for objects derived from a class via type casting in compar function same as the way you have done by casting those void* pointers to int* pointer. "
If I understood above correctly, I think I have understood the utility of call back functions correctly. Please verify my understanding and oblige.
Could you please share video with information regarding how callback function is different from goto ?
good bro
Can you implement asynchronous call back function?
Thanx 😅
Thaks a lot!
great video
everyone explains what you explained...but give real time example of synchronous and asynchronous callback functions
So callback functions are like interrupts?
They are more like interrupt service routines.
@@codeflash6896 Why don't use function call from inside the function? What added value we get from putting function as argument?
Because different callback functions can be called from a single "main" function.
By providing the callback function as an argument to a "main" function, the code is more generic since only this "main" function is needed to call different callback functions within it.
The alternative would be to have multiple different "main" functions that each call their hardcoded callback function. This creates code duplication.
لهجه ای ایرانی داره