forked from zig/exercises
008 ✅
This commit is contained in:
parent
332f56b6b4
commit
a1dd3b038a
|
@ -19,7 +19,7 @@ pub fn main() void {
|
||||||
// the idiomatic type to use for array indexing.
|
// the idiomatic type to use for array indexing.
|
||||||
//
|
//
|
||||||
// There IS a problem on this line, but 'usize' isn't it.
|
// There IS a problem on this line, but 'usize' isn't it.
|
||||||
const x: usize = 1;
|
var x: usize = 1;
|
||||||
|
|
||||||
// Note: When you want to declare memory (an array in this
|
// Note: When you want to declare memory (an array in this
|
||||||
// case) without putting anything in it, you can set it to
|
// case) without putting anything in it, you can set it to
|
||||||
|
@ -33,10 +33,10 @@ pub fn main() void {
|
||||||
lang[0] = letters[x];
|
lang[0] = letters[x];
|
||||||
|
|
||||||
x = 3;
|
x = 3;
|
||||||
lang[???] = letters[x];
|
lang[1] = letters[x];
|
||||||
|
|
||||||
x = ???;
|
x = 5;
|
||||||
lang[2] = letters[???];
|
lang[2] = letters[x];
|
||||||
|
|
||||||
// We want to "Program in Zig!" of course:
|
// We want to "Program in Zig!" of course:
|
||||||
std.debug.print("Program in {s}!\n", .{lang});
|
std.debug.print("Program in {s}!\n", .{lang});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user