02_std.zig 889 B

123456789101112131415161718192021222324
  1. //
  2. // Oops! This program is supposed to print a line like our Hello World
  3. // example. But we forgot how to import the Zig Standard Library.
  4. //
  5. // The @import() function is built into Zig. It returns a value which
  6. // represents the imported code. It's a good idea to store the import as
  7. // a constant value with the same name as the import:
  8. //
  9. // const foo = @import("foo");
  10. //
  11. // Please complete the import below:
  12. //
  13. ??? = @import("std");
  14. pub fn main() void {
  15. std.debug.print("Standard Library.\n", .{});
  16. }
  17. // Going deeper: imports must be declared as "constants" (with the 'const'
  18. // keyword rather than "variables" (with the 'var' keyword) is that they
  19. // can only be used at "compile time" rather than "run time". Zig evaluates
  20. // const values at compile time. Don't worry if none of this makes sense
  21. // yet! See also this answer: https://stackoverflow.com/a/62567550/695615