pedropark99 / zig-book

An open, technical and introductory book for the Zig programming language
https://pedropark99.github.io/zig-book/
Other
590 stars 21 forks source link

Runtime know length versus compile-time know length in slices #47

Closed pedropark99 closed 1 month ago

pedropark99 commented 1 month ago

Slices that have a compile-time known length are under the hood just a single-item pointer to an array. In contrast, a slice that have a runtime known length is a really a slice object. Is a good idea to include a section in the book to describe this, because:

More details on: https://ziglang.org/documentation/master/#Slices