• Ephera@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    3 months ago

    Dumb question, but when would you need two deep? Is it when you store a pointer as a field in a struct?

    If so, isn’t that a massive footgun, because the pointer might go invalid at any point? 🫠

    • SpaceNoodle@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      3 months ago

      Pointers to arrays or arrays of pointers are common examples.

      Your pointers won’t just magically become invalid. You gotta fuck 'em up first.