basic/advanced_type/array #72
Replies: 7 comments 8 replies
-
|
Beta Was this translation helpful? Give feedback.
-
那 改为 |
Beta Was this translation helpful? Give feedback.
-
多行字符串这里要注明一下,windows下换行默认是 \r\n结尾的,编译期就失败了。必须保证以\n结尾才能用 |
Beta Was this translation helpful? Give feedback.
-
要说明的是这么个问题在官方文档里也没有说明这个 : const message []u8 = .{ 'h', 'e', 'l', 'l', 'o' }; //这个是错误的,数组需要在编译期间就知道它的大小,这样的话编译器就能合理的分配内存了。而上面的写法之所以错误就是因为“”号是推断出来的长度,放在等号前就是不对的编译器不知道到底要计算哪个才对。希望指正 |
Beta Was this translation helpful? Give feedback.
-
乘法那里实际的意思是不是重复序列 |
Beta Was this translation helpful? Give feedback.
-
串联并不要求两个数组的长度必须一致。 |
Beta Was this translation helpful? Give feedback.
-
你好,你的“编译期初始化数组”部分(也就是最后一部分),init块没有添加comptime关键字,也就是comptime init{}; |
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/array
简单、快速地学习 Zig,ziglang中文教程,zig中文教程
https://course.ziglang.cc/basic/advanced_type/array.html
Beta Was this translation helpful? Give feedback.
All reactions