Chapter Summary

for Zig 0.15.2 Buy

Chapter Summary

To make decisions and execute different paths in our programs, we use boolean expressions along with control blocks:

We can also return values and assign them to a constant or variable directly from one of these blocks, as long as we don’t use {} braces to delimit them.

Switch can also return a value or execute code, similar to an if.


Switch
Arrays and Slices
© 2025 - 2026 Zen of Zig