mirror of
https://github.com/epasveer/seer.git
synced 2026-08-29 16:40:42 +08:00
Add more Zig test programs.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user