Addressing wrong type for the pointer example

The other option would be to change x from const to var:

```
var x: i32 =1;
const pointer: *i32 = &x
```
This commit is contained in:
Kenneth Brooks 2025-01-22 15:11:34 -05:00 committed by GitHub
parent c3c2f20a80
commit 31edc043d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

2
zig.md
View File

@ -204,7 +204,7 @@ const slice = array[0..array.len]; // "slice" represents the whole array.
```zig
// Pointer on a value can be created with "&".
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});
// Pointer values are accessed and modified with ".*".