mirror of
https://github.com/ziglang/zig.git
synced 2026-02-21 16:54:52 +00:00
langref: tweak description of []T (#12319)
saying []T is a pointer is confusing because zig docs say there are two types of pointers (*T and [*]T). It is more clear to say that []T is a slice type which contains a [*]T pointer and a length. Co-authored-by: Philipp Lühmann <47984692+luehmann@users.noreply.github.com>
This commit is contained in:
parent
7a733b9385
commit
2b92c5a23e
@ -2631,7 +2631,7 @@ test "Conversion between vectors, arrays, and slices" {
|
||||
</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li>{#syntax#}[]T{#endsyntax#} - pointer to runtime-known number of items.
|
||||
<li>{#syntax#}[]T{#endsyntax#} - is a slice (a fat pointer, which contains a pointer of type {#syntax#}[*]T{#endsyntax#} and a length).
|
||||
<ul>
|
||||
<li>Supports index syntax: {#syntax#}slice[i]{#endsyntax#}</li>
|
||||
<li>Supports slice syntax: {#syntax#}slice[start..end]{#endsyntax#}</li>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user