basic/advanced_type/pointer #78
Replies: 5 comments 14 replies
-
数组和切片的示例中(多项指针 >> 提示), 作者应该是想表示切片的示例? 如果是切片的示例, 例子是不是错了? const print = @import("std").debug.print;
pub fn main() !void {
const array = [_]i32{ 1, 2, 3, 4 };
const ptr: [*]const i32 = &array;
print("第一个元素:{}\n", .{ptr[0]});
} const ptr: [*]const i32 = &array; |
Beta Was this translation helpful? Give feedback.
-
你好,可以解释下 &6, &false 这种写法吗? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
如果 slice(如 []u8)中的 .len 是 Runtime Value,那么如果理解编译期 [:0]const u8 字符串字面量呢? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
basic/advanced_type/pointer
简单、快速地学习 Zig,ziglang中文教程,zig中文教程
https://course.ziglang.cc/basic/advanced_type/pointer.html
Beta Was this translation helpful? Give feedback.
All reactions