mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-04-26 15:13:56 +00:00
Merge da335c4971
into 7f0f27d84d
This commit is contained in:
commit
8cb1faf1d8
3
zig.md
3
zig.md
@ -3,6 +3,7 @@ name: Zig
|
|||||||
filename: learnzig.zig
|
filename: learnzig.zig
|
||||||
contributors:
|
contributors:
|
||||||
- ["Philippe Pittoli", "https://karchnu.fr/"]
|
- ["Philippe Pittoli", "https://karchnu.fr/"]
|
||||||
|
- ["Kenneth Brooks", "https://github.com/zendril"]
|
||||||
---
|
---
|
||||||
|
|
||||||
[Zig][ziglang] aims to be a replacement for the C programming language.
|
[Zig][ziglang] aims to be a replacement for the C programming language.
|
||||||
@ -204,7 +205,7 @@ const slice = array[0..array.len]; // "slice" represents the whole array.
|
|||||||
```zig
|
```zig
|
||||||
// Pointer on a value can be created with "&".
|
// Pointer on a value can be created with "&".
|
||||||
const x: i32 = 1;
|
const x: i32 = 1;
|
||||||
const pointer: *i32 = &x; // "pointer" is a pointer on the i32 var "x".
|
const pointer: *const i32 = &x; // "pointer" is a pointer on the const i32 var "x".
|
||||||
print("1 = {}, {}\n", .{x, pointer});
|
print("1 = {}, {}\n", .{x, pointer});
|
||||||
|
|
||||||
// Pointer values are accessed and modified with ".*".
|
// Pointer values are accessed and modified with ".*".
|
||||||
|
Loading…
Reference in New Issue
Block a user