test:zig
This commit is contained in:
22
guide/language/assignment.zig
Normal file
22
guide/language/assignment.zig
Normal file
@@ -0,0 +1,22 @@
|
||||
const std = @import("std");
|
||||
const print = std.debug.print;
|
||||
|
||||
pub fn main() !void {
|
||||
const constant: i32 = 5; // Immutable variable
|
||||
var variable: i32 = 5000; // Mutable variable
|
||||
|
||||
_ = constant;
|
||||
variable += 1;
|
||||
|
||||
const inferred_constant: i32 = @as(i32, 5);
|
||||
var inferred_variable: i32 = @as(i32, 5000);
|
||||
inferred_variable += 1;
|
||||
print("inferred_constant: {}, inferred_variable: {}\n", .{ inferred_constant, inferred_variable });
|
||||
|
||||
const a: i32 = undefined;
|
||||
const b: i32 = undefined;
|
||||
const c: u8 = undefined;
|
||||
const d: u8 = 170;
|
||||
|
||||
print("a: {}, b: {}, c: {}, d: {}\n", .{ a, b, c, d });
|
||||
}
|
||||
Reference in New Issue
Block a user