Zig in Depth: HashMap

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

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

  • @alirezanet
    @alirezanet 10 месяцев назад

    First of all, thank you for these great and rare content.
    just a question, are you planning to create some videos regarding "threading" in Zig and also about when we need to pass a pointer and when it is not needed? I find it really confusing for me ( as a dotnet developer perspective I mostly tend to pass all the object around by reference but apparently it is not needed ... e.g. allocators or slices ) ... can't wait to watch these topics 😊
    Cheers

    • @dudethebuilder
      @dudethebuilder  10 месяцев назад +1

      Yes threading is definitely planned for a future video, and the topic of passing a value or a pointer to a function is gaining popularity so I'll do some more research to prepare en episode on it.

  • @DanMackAlpha
    @DanMackAlpha 3 месяца назад +1

    interesting, when I just compiled this code on a fresh zig build (version 14.0-dev.109), I get a compile error because it thinks that gopr should be a const instead of a var. thanks for the video on making and using hashmaps.

    • @dudethebuilder
      @dudethebuilder  3 месяца назад

      Hmm, good to know. I haven't tried 0.14 yet. Tahnks for the heads-up!

  • @wondays654
    @wondays654 11 месяцев назад +1

    I'm struggling with the StringHashMap in Zig. The get function does not retrieve the data even when it is in the table. It just always returns null. I have been at it for 2 days now without a fix. I asked on reddit and no luck, but not many places where I can get help with this.

    • @dudethebuilder
      @dudethebuilder  11 месяцев назад +3

      String keys can be tricky given that they contain pointers which could be invalid at some point. I recommend heading over to ziggit.dev so you can post your code sample and the community can try to help. Posting code over here on RUclips is really messy.

    • @wondays654
      @wondays654 11 месяцев назад

      ​@@dudethebuilderthank you.