Back to Basics: Pointers - Mike Shah - CppCon 2021

Поделиться
HTML-код
  • Опубликовано: 7 ноя 2024

Комментарии • 27

  • @joebosah2727
    @joebosah2727 2 года назад +7

    Thank you, Mike. This is a masterclass presentation on raw pointers. Thanks again

    • @CppCon
      @CppCon  2 года назад

      Glad it was helpful!

  • @biglebowskee
    @biglebowskee 2 года назад +4

    Probably one of the best explanations of pointers. Nice and simple, step by step.

    • @CppCon
      @CppCon  2 года назад

      Glad you think so! Thank you.

  • @davidmiller1376
    @davidmiller1376 Год назад +2

    Thank you, Mike. Got a handle on function pointers now. Cheers!

    • @MikeShah
      @MikeShah 5 месяцев назад

      Cheers!

  • @prakhargupta2960
    @prakhargupta2960 2 года назад +4

    great talk! to sum it up, with great power comes great responsibility!
    thanks mike

  • @nilgurkas7947
    @nilgurkas7947 2 года назад +4

    Great Presentation, thank you for this Mike Shah.

    • @CppCon
      @CppCon  2 года назад

      Glad you enjoyed it!

  • @vigneshpb9
    @vigneshpb9 2 года назад +2

    Great Talk, probably one of the few talks that I listened to fully ! :)

    • @CppCon
      @CppCon  2 года назад

      Glad you enjoyed it!

  • @aloluk
    @aloluk 2 года назад +2

    I'm glad you said you forget the function ptr syntax. I've been programming games for 20 years in c++ and still forget it aswell :). At least lambdas are more intuitive.

    • @alexandernyberg8668
      @alexandernyberg8668 2 года назад +1

      I don't think function pointer syntax is too hard to understand; functions returning function pointers on the other hand...

    • @md2perpe
      @md2perpe 2 года назад

      @@alexandernyberg8668 What's difficult with that?

    • @darranrowe174
      @darranrowe174 2 года назад

      @@alexandernyberg8668 That's why you typedef/using it. That way all you have to do is just use the type alias and not worry about the weirdness.

    • @darranrowe174
      @darranrowe174 2 года назад +1

      @@md2perpe If you understand how names in function pointers work, nothing. But if you are trying to write a function that returns a function pointer without using type aliases, then it ends up something like:
      void(*return_fun_ptr(int))();
      This is a function named return_fun_ptr that takes a single int parameter that returns a pointer to a function that takes no parameters and returns void.

  • @RodriTheMighty
    @RodriTheMighty 2 года назад +2

    Good Sound! Always great to not have reverb ob everything

  • @jhbonarius
    @jhbonarius 2 года назад +2

    For me it's always been interesting that some CS people find pointers difficult. I came to C++ from electrical engineering, so bottom up, and just intuitively map the numbers to memory locations (ram,rom or device). (Sometimes a bit too much, as virtual memory mapping, addressa translations, caching etc sometimes confuses me. )

    • @md2perpe
      @md2perpe 2 года назад +1

      In the mid of the 1980's I learned Z80 assembly. The Z80 processor has a 16-bit register HL which can be used to refer to content at some location in memory. Some year after that I learned some Pascal from a book and there was a chapter about pointers. It was confusing to me, and I didn't understand it. Later I learned C and then it hit me: pointers are just memory addresses; it's just like (HL) in Z80 assembly.

  • @alexandrebustico9691
    @alexandrebustico9691 2 года назад +1

    @26.06, memory representation is wrong for f due to alignment, float value will be aligned on 4 bytes

  • @akarthickarun
    @akarthickarun 2 года назад +1

    Wonderful presentation. Thanks a lot.

  • @md2perpe
    @md2perpe 2 года назад +2

    I don't like the last part of the description "A pointer is a variable that stores the memory address of a specific object type". The object type is not really part of the pointer; it's rather information to the compiler (and to the programmer) what kind of data is found at that address so that one can easily access for example parts of a structure.

  • @Mythic_Echoes
    @Mythic_Echoes 2 года назад +1

    Now let's try to get my coworker watch this

  • @sanjaygatne1424
    @sanjaygatne1424 2 года назад +1

    code font size too small to read.

  • @gongfei
    @gongfei 2 года назад +3

    I don't think its the right way to teach pointers, same as 30 years ago. It's better to introduce ownership at the very first stage, for "modern" learners who's new to c++.

  • @quanzhou4608
    @quanzhou4608 2 года назад

    黃暐瀚你怎么开始搞C++了?