Callback Functions in C Explained

Поділитися
Вставка
  • Опубліковано 15 вер 2024

КОМЕНТАРІ • 35

  • @xaiga29
    @xaiga29 3 роки тому +19

    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 6 місяців тому +4

    Clear and straight to the point. Thanks.

  • @netsweemji
    @netsweemji 2 роки тому +7

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

  • @bizzy423
    @bizzy423 3 роки тому +4

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

  • @alikemalaldogan2492
    @alikemalaldogan2492 11 місяців тому

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

  • @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!

  • @moizkhan132
    @moizkhan132 3 роки тому +1

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

  • @almnetx
    @almnetx 2 роки тому

    Best Callback Explanation Ever! Thanks my friend, GBY!

  • @redmundperrz7234
    @redmundperrz7234 5 місяців тому

    Very good explanation and sample of function pointer

  • @shadabpundeer3105
    @shadabpundeer3105 10 місяців тому

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

  • @ImmortalBest
    @ImmortalBest 2 роки тому +5

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

  • @atticusrussell1225
    @atticusrussell1225 21 день тому

    Great tutorial!

  • @JamesEggleston
    @JamesEggleston 3 роки тому

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

  • @austinbaccus
    @austinbaccus 3 роки тому +1

    Awesome video. Thank you for the explanation! :)

    • @codeflash6896
      @codeflash6896  3 роки тому +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.

  • @justdoingodswork
    @justdoingodswork 2 роки тому

    Thank for this video, really helped me.

  • @shrikantvaishnav1077
    @shrikantvaishnav1077 3 роки тому

    Short and precise description 👍👍👍

  • @yadniksn6657
    @yadniksn6657 3 роки тому

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

  • @MegaMicraman
    @MegaMicraman 11 місяців тому

    Very good.

  • @atharwaadawdakar4144
    @atharwaadawdakar4144 3 роки тому +1

    Great explanation !!

  • @christopherlabisch621
    @christopherlabisch621 Рік тому +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?

  • @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.

  • @dahlia2631
    @dahlia2631 3 роки тому

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

  • @fokusdesain9521
    @fokusdesain9521 4 місяці тому

    good bro

  • @NeverGiveUp_oo7
    @NeverGiveUp_oo7 Рік тому

    Can you implement asynchronous call back function?

  • @ubaidarshad
    @ubaidarshad 6 місяців тому

    Thanx 😅

  • @juanalbertofalconquezada3738
    @juanalbertofalconquezada3738 3 роки тому

    Thaks a lot!

  • @coachremmy
    @coachremmy 3 роки тому

    great video

  • @mehulshah9027
    @mehulshah9027 3 роки тому +5

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

  • @yonatanelizarov6747
    @yonatanelizarov6747 Рік тому

    So callback functions are like interrupts?

    • @codeflash6896
      @codeflash6896  Рік тому

      They are more like interrupt service routines.

    • @yonatanelizarov6747
      @yonatanelizarov6747 Рік тому

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

    • @codeflash6896
      @codeflash6896  Рік тому +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.

  • @ghaderiimuhammad_english8622
    @ghaderiimuhammad_english8622 Місяць тому

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