-
Notifications
You must be signed in to change notification settings - Fork 3
Array
Chung Leong edited this page Feb 11, 2024
·
12 revisions
In Zig, arrays can contain only a single type of values. Their lengths are fixed at compile time.
const std = @import("std");
pub fn print4(values: i32) void {
std.debug.print("{d}\n", .{values});
}
import { print4 } from './array-example-1.zig';
print4([ 123, 234, 345, 456 ]);
123, 234, 345, 456
Array objects support bracket operator and iterator.