61-72
This commit is contained in:
parent
28dc209134
commit
723822e800
12 changed files with 23 additions and 23 deletions
|
|
@ -35,7 +35,7 @@ pub fn main() void {
|
|||
// In this contrived example, we've decided to allocate some
|
||||
// arrays using a variable count! But something's missing...
|
||||
//
|
||||
var count = 0;
|
||||
comptime var count = 0;
|
||||
|
||||
count += 1;
|
||||
const a1: [count]u8 = .{'A'} ** count;
|
||||
|
|
@ -60,5 +60,5 @@ pub fn main() void {
|
|||
//
|
||||
// Try uncommenting this line and playing around with it
|
||||
// (copy it, move it) to see what it does:
|
||||
//@compileLog("Count at compile time: ", count);
|
||||
// @compileLog("Count at compile time: ", count);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue