diff options
| author | Josh Holland <josh@inv.alid.pw> | 2020-12-15 18:41:50 +0000 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2020-12-17 19:01:13 +0200 |
| commit | e93cb2254171f38317f97e685b79dec397f47bb7 (patch) | |
| tree | 73d15f477a6f6e71ad90021a79535d21667faf39 /doc | |
| parent | e16997a66cd8eccc5d7bcb819355100b34ce5c44 (diff) | |
| download | zig-e93cb2254171f38317f97e685b79dec397f47bb7.tar.gz zig-e93cb2254171f38317f97e685b79dec397f47bb7.zip | |
Improve documentation for string slices.
Closes #7454.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/langref.html.in | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/langref.html.in b/doc/langref.html.in index f380f72e6d..4da04f41e8 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -2328,10 +2328,10 @@ const mem = std.mem; const fmt = std.fmt; test "using slices for strings" { - // Zig has no concept of strings. String literals are const pointers to - // arrays of u8, and by convention parameters that are "strings" are - // expected to be UTF-8 encoded slices of u8. - // Here we coerce [5]u8 to []const u8 + // Zig has no concept of strings. String literals are const pointers + // to null-terminated arrays of u8, and by convention parameters + // that are "strings" are expected to be UTF-8 encoded slices of u8. + // Here we coerce *const [5:0]u8 and *const [6:0]u8 to []const u8 const hello: []const u8 = "hello"; const world: []const u8 = "世界"; |
