Callback Functions in C Explained

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 ม.ค. 2025

ความคิดเห็น • 35

  • @xaiga29
    @xaiga29 3 ปีที่แล้ว +20

    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!

  • @jasnarmstrng
    @jasnarmstrng 10 หลายเดือนก่อน +4

    Clear and straight to the point. Thanks.

  • @alikemalaldogan2492
    @alikemalaldogan2492 ปีที่แล้ว +1

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

  • @bizzy423
    @bizzy423 4 ปีที่แล้ว +4

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

  • @netsweemji
    @netsweemji 3 ปีที่แล้ว +7

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

  • @dhruvandangar8005
    @dhruvandangar8005 2 ปีที่แล้ว +3

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

  • @slavago_1
    @slavago_1 2 ปีที่แล้ว +1

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

  • @almnetx
    @almnetx 3 ปีที่แล้ว

    Best Callback Explanation Ever! Thanks my friend, GBY!

  • @moizkhan132
    @moizkhan132 3 ปีที่แล้ว +1

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

  • @redmundperrz7234
    @redmundperrz7234 9 หลายเดือนก่อน

    Very good explanation and sample of function pointer

  • @shadabpundeer3105
    @shadabpundeer3105 ปีที่แล้ว

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

  • @shrikantvaishnav1077
    @shrikantvaishnav1077 3 ปีที่แล้ว

    Short and precise description 👍👍👍

  • @christopherlabisch621
    @christopherlabisch621 2 ปีที่แล้ว +1

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

  • @atharwaadawdakar4144
    @atharwaadawdakar4144 3 ปีที่แล้ว +1

    Great explanation !!

  • @justdoingodswork
    @justdoingodswork 2 ปีที่แล้ว

    Thank for this video, really helped me.

  • @austinbaccus
    @austinbaccus 4 ปีที่แล้ว +1

    Awesome video. Thank you for the explanation! :)

    • @codeflash6896
      @codeflash6896  4 ปีที่แล้ว +1

      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.

  • @ImmortalBest
    @ImmortalBest 2 ปีที่แล้ว +5

    найс инглиш, мой славянский друг )

  • @JamesEggleston
    @JamesEggleston 3 ปีที่แล้ว

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

  • @atticusrussell1225
    @atticusrussell1225 4 หลายเดือนก่อน

    Great tutorial!

  • @yadniksn6657
    @yadniksn6657 3 ปีที่แล้ว

    Nice explanation.
    Plz add more vdos on this topic like sending struct pointer and many more.🙏🙏

  • @cyberspider78910
    @cyberspider78910 2 ปีที่แล้ว

    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.

  • @NeverGiveUp_oo7
    @NeverGiveUp_oo7 ปีที่แล้ว

    Can you implement asynchronous call back function?

  • @dahlia2631
    @dahlia2631 3 ปีที่แล้ว

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

  • @MegaMicraman
    @MegaMicraman ปีที่แล้ว

    Very good.

  • @yonatanelizarov6747
    @yonatanelizarov6747 2 ปีที่แล้ว

    So callback functions are like interrupts?

    • @codeflash6896
      @codeflash6896  2 ปีที่แล้ว

      They are more like interrupt service routines.

    • @yonatanelizarov6747
      @yonatanelizarov6747 2 ปีที่แล้ว

      @@codeflash6896 Why don't use function call from inside the function? What added value we get from putting function as argument?

    • @codeflash6896
      @codeflash6896  2 ปีที่แล้ว +1

      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.

  • @fokusdesain9521
    @fokusdesain9521 8 หลายเดือนก่อน

    good bro

  • @coachremmy
    @coachremmy 4 ปีที่แล้ว

    great video

  • @juanalbertofalconquezada3738
    @juanalbertofalconquezada3738 3 ปีที่แล้ว

    Thaks a lot!

  • @ubaidarshad
    @ubaidarshad 10 หลายเดือนก่อน

    Thanx 😅

  • @mehulshah9027
    @mehulshah9027 4 ปีที่แล้ว +5

    everyone explains what you explained...but give real time example of synchronous and asynchronous callback functions

  • @ghaderiimuhammad_english8622
    @ghaderiimuhammad_english8622 5 หลายเดือนก่อน

    لهجه ای ایرانی داره