[zig] simpler multidimensional arrays (#5262)
Some checks failed
Trigger site build / deploy (push) Has been cancelled
CI / lint (push) Has been cancelled

This commit is contained in:
Roman Frołow 2025-02-25 13:56:17 +01:00 committed by GitHub
parent 42ff954780
commit 3115176643
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

8
zig.md
View File

@ -153,10 +153,10 @@ try some_integers[i]; // Runtime error 'index out of bounds'.
```zig ```zig
const mat4x4 = [4][4]f32{ const mat4x4 = [4][4]f32{
[_]f32{ 1.0, 0.0, 0.0, 0.0 }, .{ 1, 0, 0, 0 },
[_]f32{ 0.0, 1.0, 0.0, 1.0 }, .{ 0, 1, 0, 1 },
[_]f32{ 0.0, 0.0, 1.0, 0.0 }, .{ 0, 0, 1, 0 },
[_]f32{ 0.0, 0.0, 0.0, 1.0 }, .{ 0, 0, 0, 1 },
}; };
// Access the 2D array then the inner array through indexes. // Access the 2D array then the inner array through indexes.