By scipio on Skatehive
Learn Zig Series (#16) - Sentinel-Terminated Types and C Strings What will I learn You will learn what sentinel-terminated types are and why Zig has them; the difference between []u8, [:0]u8, [:0]u8, and [c]u8; how C strings (null-terminated) map to Zig's type system; converting between Zig slices and C strings safely; the std.mem.span() function for finding sentinel boundaries; sentinel-terminated arrays and their compile-time guarantees; working with C string APIs: strlen, strcmp equivalents in Zig; common pitfalls when mixing Zig and C string conventions. Requirements A working modern computer running macOS, Windows or Ubuntu; An installed Zig 0.14+ distribution (download from ziglang.org); The ambition to learn Zig programming. Difficulty Intermediate Curriculum (of the Learn Zig Series): Zig Programming Tutorial - ep001 - Intro Learn Zig Series (#2) - Hello Zig, Variables and Types Learn Zig Series (#3) - Functions and Control Flow Learn Zig Series (#4) - Error Handling (Zig's Bes