You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
889 B
Zig
25 lines
889 B
Zig
4 years ago
|
//
|
||
|
// Oops! This program is supposed to print a line like our Hello World
|
||
|
// example. But we forgot how to import the Zig Standard Library.
|
||
|
//
|
||
4 years ago
|
// The @import() function is built into Zig. It returns a value which
|
||
|
// represents the imported code. It's a good idea to store the import as
|
||
|
// a constant value with the same name as the import:
|
||
4 years ago
|
//
|
||
4 years ago
|
// const foo = @import("foo");
|
||
|
//
|
||
|
// Please complete the import below:
|
||
|
//
|
||
|
|
||
|
??? = @import("std");
|
||
4 years ago
|
|
||
|
pub fn main() void {
|
||
|
std.debug.print("Standard Library.\n", .{});
|
||
|
}
|
||
|
|
||
|
// Going deeper: imports must be declared as "constants" (with the 'const'
|
||
|
// keyword rather than "variables" (with the 'var' keyword) is that they
|
||
|
// can only be used at "compile time" rather than "run time". Zig evaluates
|
||
|
// const values at compile time. Don't worry if none of this makes sense
|
||
|
// yet! See also this answer: https://stackoverflow.com/a/62567550/695615
|