Callback Functions in C Explained

preview_player
Показать описание
This video explains callback functions and shows how to implement them in C.

At the start, basics of callback functions are explained. Next, an example is shown that demonstrates how to easily implement callback functions in C. Lastly, an example is shown on how to use the qsort() function that is inside the C standard library.

Code:

Chapters:
00:00 Introduction
00:18 Basics of Callback Functions
02:05 First Example: Implementation, Passing and Calling Callback Functions
05:58 First Example: A Simplification of the Function Pointer Syntax by Using a typedef
07:03 Second Example: An Explanation of the qsort() Function Which Uses Callback Functions
08:58 Second Example: An Implementation of a Comparison Callback Function and It's Usage for the qsort() Function
13:15 Outro

LIKE | COMMENT | SHARE | SUBSCRIBE
Рекомендации по теме
Комментарии
Автор

First video I ever watched that helped me understand call back functions fully. Thank you

teriyakichicken
Автор

Clear and straight to the point. Thanks.

jasnarmstrng
Автор

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!

xaiga
Автор

I really liked the content. At these days it is very hard to find a deeply and simply videos. Thanks

alikemalaldogan
Автор

You explained it well .it is very good and easy to understand.

netsweemji
Автор

Thank You for going more in depth in your example using qsort. Look forward to your "C" videos!

bizzy
Автор

Best Callback Explanation Ever! Thanks my friend, GBY!

almnetx
Автор

very informative.
that type of deep knowledge content we need.
please make more of these types of videos.

dhruvandangar
Автор

Wow, I understand everything you explained in the video so easily! Thank you very much!

slavago_
Автор

This video is great, You cleared my concept of callback and function pointer, Thanks a lot

moizkhan
Автор

Very good explanation and sample of function pointer

redmundperrz
Автор

Thank for this video, really helped me.

justdoingodswork
Автор

That’s was such a good explanation, thanks!!

JamesEggleston
Автор

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):
}

shadabpundeer
Автор

Awesome video. Thank you for the explanation! :)

austinbaccus
Автор

Thank you very much. Very precise and to the point.
I have a question. Is it possible to implement asynchronous callback functions in C?

christopherlabisch
Автор

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.

cyberspider
Автор

Could you please share video with information regarding how callback function is different from goto ?

dahlia
Автор

Can you implement asynchronous call back function?

NeverGiveUp_oo
Автор

So callback functions are like interrupts?

yonatanelizarov