No video

Zig Master: Let's Create a Stack!

  Рет қаралды 1,206

Dude the Builder

Dude the Builder

Күн бұрын

Help me create more content like this!
www.paypal.com...
With all the knowledge we've acquired so far, we can build our very own data structure in Zig. In this episode, we'll build a stack that can handle growth via heap allocation and as a bonus we even make it generic. NOTE: I had a little off-by-one bug in the code shown in the video where I compared the slice length plus one as greater than or equal to, when it should be just greater than (in the push method). I made the fix and the code in the repo is now correct.
The code: codeberg.org/d...
Relevant Links:
- ziglang.org/do...
Thumbnail artwork courtesy of: www.deviantart...

Пікірлер: 8
@EliasDorneles
@EliasDorneles Ай бұрын
This is great stuff, man! This example is exactly what I needed: it answers several questions I had and gives a great example of generic data structure! Thank you so much for this!
@raptorate2872
@raptorate2872 Ай бұрын
Hello Dude thanks for all your help, you are a lifesaver for those who want to learn zig. May i ask how to navigate through the 2 different playlists you have. It would seem like they have overlapping concepts.
@dudethebuilder
@dudethebuilder Ай бұрын
Thanks for the support. I would recommend watching the videos in Zig in Depth first, specifically those that pertain to the language and not the build system or project tools. Then you can catch up with recent changes with the videos in Zig Master.
@juanpablouriolbalbin887
@juanpablouriolbalbin887 Ай бұрын
I think you are allocating new memory even though you still have space for one more element. In your example, you double the capacity from 8 to 16 when you add the 7th element (index 6). Therefore, you still have space for an 8th element.
@dudethebuilder
@dudethebuilder 28 күн бұрын
Correct! I noticed that just as I finished recording the video and added a note to the description. The actual code on the repo has been fixed. Thanks for the heads-up.
Zig Master: Let's Create a Trie!
17:14
Dude the Builder
Рет қаралды 1,8 М.
Harder Drive: Hard drives we didn't want or need
36:47
suckerpinch
Рет қаралды 1,6 МЛН
Ik Heb Aardbeien Gemaakt Van Kip🍓🐔😋
00:41
Cool Tool SHORTS Netherlands
Рет қаралды 8 МЛН
SPILLED CHOCKY MILK PRANK ON BROTHER 😂 #shorts
00:12
Savage Vlogs
Рет қаралды 47 МЛН
Happy birthday to you by Tsuriki Show
00:12
Tsuriki Show
Рет қаралды 10 МЛН
Andrew Kelley   Practical Data Oriented Design (DoD)
46:40
ChimiChanga
Рет қаралды 81 М.
Zig Master: Introduction to Allocators
34:19
Dude the Builder
Рет қаралды 1,5 М.
Lanczos Image Resizing in Rust from scratch
44:55
MrJakob
Рет қаралды 305
I Parsed 1 Billion Rows Of Text (It Sucked)
39:23
Theo - t3․gg
Рет қаралды 127 М.
Zig Master: Memory in Practice
20:45
Dude the Builder
Рет қаралды 1 М.
Linux from Scratch
2:35:42
Titus Tech Talk
Рет қаралды 149 М.
I Tried JAI, Can It Replace C++?! (Programming Language)
21:05
Zig Master: Single Item Pointer
18:02
Dude the Builder
Рет қаралды 579
Ik Heb Aardbeien Gemaakt Van Kip🍓🐔😋
00:41
Cool Tool SHORTS Netherlands
Рет қаралды 8 МЛН