002_std.zig 819 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. // For the curious: Imports must be declared as constants because they
  18. // can only be used at compile time rather than run time. Zig evaluates
  19. // constant values at compile time. Don't worry, we'll cover imports
  20. // in detail later.
  21. // Also see this answer: https://stackoverflow.com/a/62567550/695615