Add more Zig test programs.

This commit is contained in:
Ernie Pasveer
2025-07-13 14:39:50 -05:00
parent 65e7f9d92e
commit 9fef0e70e1
12 changed files with 316 additions and 5 deletions
+26
View File
@@ -0,0 +1,26 @@
const std = @import("std");
const print = std.debug.print;
const Single = *bool;
const Many = [*]bool;
const Null = ?*bool;
pub fn main() !void {
var v = false;
const ptr: *bool = &v;
print("pointer: {}\n", .{ptr});
ptr.* = true;
print("value: {}\n", .{ptr.*});
const const_ptr: *bool = &v;
const_ptr.* = false;
const cf = false;
const ct = true;
var ptr_to_const: *const bool = &cf;
ptr_to_const = &ct;
}