mirror of
https://github.com/epasveer/seer.git
synced 2026-08-29 16:40:42 +08:00
27 lines
458 B
Zig
27 lines
458 B
Zig
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;
|
|
}
|