Skip to content

Commit

Permalink
[zig] simpler multidimensional arrays (#5262)
Browse files Browse the repository at this point in the history
  • Loading branch information
rofrol authored Feb 25, 2025
1 parent 42ff954 commit 3115176
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions zig.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ try some_integers[i]; // Runtime error 'index out of bounds'.

```zig
const mat4x4 = [4][4]f32{
[_]f32{ 1.0, 0.0, 0.0, 0.0 },
[_]f32{ 0.0, 1.0, 0.0, 1.0 },
[_]f32{ 0.0, 0.0, 1.0, 0.0 },
[_]f32{ 0.0, 0.0, 0.0, 1.0 },
.{ 1, 0, 0, 0 },
.{ 0, 1, 0, 1 },
.{ 0, 0, 1, 0 },
.{ 0, 0, 0, 1 },
};
// Access the 2D array then the inner array through indexes.
Expand Down

0 comments on commit 3115176

Please sign in to comment.