Function Pointers in C - How to Read and Write Function Pointer Types and use Dynamic Dispatch

Sdílet
Vložit
  • čas přidán 22. 07. 2024

Komentáře • 9

  • @marcoliebl3715
    @marcoliebl3715 Před 2 lety +2

    Thank you very much from a german IT student that now understands function pointers way better :-)

  • @grimvian
    @grimvian Před rokem

    Ladies and gentlemen, this is how you teach. Kris is oozing with competence and pedagogical thoughts.
    I now feel comfortable with C and know about 19 different CZcamsrs teaching C, but Kris takes teaching to a higher level.
    It's really nice that there's no fancy video editing or irrelevant noise or music - just bare teaching!

  • @vishvanathkarthi4311
    @vishvanathkarthi4311 Před 3 lety +1

    Damn! Thank you for this Kris. It is very helpful.

  • @UmmadikTas
    @UmmadikTas Před 3 lety +1

    Thank you. I'm supposed to be doing my OS assignment but the video was really interesting xd

  • @philipphortnagl2486
    @philipphortnagl2486 Před rokem

    great as always

  • @LingvoScienceUSA
    @LingvoScienceUSA Před 7 měsíci

    What's that plugin for C?

  • @jamiesandell4405
    @jamiesandell4405 Před 2 lety

    Great.

  • @lattehour
    @lattehour Před 3 měsíci

    it`s the same as with pointers to arrays you have to use parenthesis around the *name because * has lower precedence than ( ) ... how else would the compiler even know that you ain`t actually declaring a ptr return type , ps when you want to use a function as a parameter in a function implemention you dont even need the pointer just write the function in the declaration and when you call that function it`s generalized by default you can simply call it with any function as the type you used in declaration e.g void euler_method( double generic_F(int, int) , dbl a , dbl b ) you can have as many as you want in the param list thne you simply use your euler_method( sqrt , 5.5, 3.3) the main ideea behind all pointer types is based on 3 reasons 1. type checking, interpretation and arithmetics without encapsulating the type of the object inside the Pointer Metadata this can`t be done as the compiler has absolutely no means of understanding the memory layout to do the arithmetics , it has no way to interpret the bits is it a double or a long int ? and it can`t understand the intent because dividing a char string by 3 has no purpose or meaning it`s absurd

    • @lattehour
      @lattehour Před 3 měsíci

      ps in assembly you can only have 6 in the param list dont know in C only ever used 3