The Zig Programming Language 0.12.0 DocumentationUnicode Code Point Literals String literals are constant single-item Pointers to null-terminated byte arrays. The type of string literals encodes both the length, and the fact that they are null-terminated coerced to both Slices and Null-Terminated Pointers. Dereferencing string literals converts them to Arrays. Because Zig source code is UTF-8 encoded, any non-ASCII bytes appearing within a string literal zig $ ./string_literals *const [5:0]u8 5 e 0 true 128169 128175 ⚡ true true 0xfe 0x9f See also: Arrays Source Encoding Escape Sequences Escape Sequences Escape Sequence Name \n Newline \r Carriage0 码力 | 241 页 | 7.37 MB | 1 年前3
The Zig Programming Language 0.11.0 DocumentationUnicode Code Point Literals String literals are constant single-item Pointers to null-terminated byte arrays. The type of string literals encodes both the length, and the fact that they are null-terminated coerced to both Slices and Null-Terminated Pointers. Dereferencing string literals converts them to Arrays. The encoding of a string in Zig is de-facto assumed to be UTF-8. Because Zig source code is UTF-8 zig $ ./string_literals *const [5:0]u8 5 e 0 true 128169 128175 ⚡ true true 0xfe 0x9f See also: Arrays Source Encoding 5.3.1. Escape Sequences Escape Sequences Escape Sequence Name \n Newline \r0 码力 | 238 页 | 7.80 MB | 1 年前3
The Zig Programming Language 0.8.1 DocumentationUnicode Code Point Literals String literals are constant single-item Pointers to null-terminated byte arrays. The type of string literals encodes both the length, and the fact that they are null-terminated coerced to both Slices and Null-Terminated Pointers. Dereferencing string literals converts them to Arrays. The encoding of a string in Zig is de-facto assumed to be UTF-8. Because Zig source code is UTF-8 possible } $ zig test test.zig Test [1/1] test "string literals"... All 1 tests passed. See also: Arrays Zig Test Source Encoding Escape Sequences Escape Sequence Name \n Newline \r Carriage Return0 码力 | 234 页 | 6.01 MB | 1 年前3
The Zig Programming Language 0.7.1 DocumentationLiterals String literals are single-item constant Pointers to null-terminated UTF-8 encoded byte arrays. The type of string literals encodes both the length, and the fact that they are null- terminated coerced to both Slices and Null-Terminated Pointers. Dereferencing string literals converts them to Arrays. Character literals have type comptime_int, the same as Integer Literals. All Escape Sequences are "h\x65llo")); } $ zig test test.zig 1/1 test "string literals"... OK All 1 tests passed. See also: Arrays Zig Test Source Encoding Escape Sequences Escape Sequence Name \n Newline \r Carriage Return0 码力 | 225 页 | 5.74 MB | 1 年前3
The Zig Programming Language 0.6.0 DocumentationLiterals String literals are single-item constant Pointers to null-terminated UTF-8 encoded byte arrays. The type of string literals encodes both the length, and the fact that they are null- terminated coerced to both Slices and Null-Terminated Pointers. Dereferencing string literals converts them to Arrays. Character literals have type comptime_int, the same as Integer Literals. All Escape Sequences are "h\x65llo")); } $ zig test test.zig 1/1 test "string literals"...OK All 1 tests passed. See also: Arrays Zig Test Source Encoding Escape Sequences Escape Sequence Name \n Newline \r Carriage Return0 码力 | 214 页 | 5.37 MB | 1 年前3
The Zig Programming Language 0.9.1 DocumentationUnicode Code Point Literals String literals are constant single-item Pointers to null-terminated byte arrays. The type of string literals encodes both the length, and the fact that they are null-terminated coerced to both Slices and Null-Terminated Pointers. Dereferencing string literals converts them to Arrays. The encoding of a string in Zig is de-facto assumed to be UTF-8. Because Zig source code is UTF-8 4 *const [5:0]u8 5 5 6 e 7 0 8 true 9 128169 10 128175 11 true 12 0xff 13 ⚡ See also: Arrays Source Encoding Escape Sequences Escape Sequences Escape Sequence Name \n Newline \r Carriage0 码力 | 234 页 | 7.90 MB | 1 年前3
The Zig Programming Language 0.5.0 DocumentationFloat Literals Floating Point Operations Operators Table of Operators Precedence Arrays Multidimensional Arrays Vectors SIMD Pointers volatile Alignment allowzero Slices struct Default Field Implicit Cast: Stricter Qualification Implicit Cast: Integer and Float Widening Implicit Cast: Arrays and Pointers Implicit Cast: Optionals Implicit Cast: Error Unions Implicit Cast: Compile-Time Known Optionals undefined String Literals and Character Literals String literals are UTF-8 encoded byte arrays. Character literals have type comptime_int, the same as Integer Literals. All Escape Sequences are0 码力 | 224 页 | 5.80 MB | 1 年前3
The Zig Programming Language 0.10.1 DocumentationUnicode Code Point Literals String literals are constant single-item Pointers to null-terminated byte arrays. The type of string literals encodes both the length, and the fact that they are null-terminated coerced to both Slices and Null-Terminated Pointers. Dereferencing string literals converts them to Arrays. The encoding of a string in Zig is de-facto assumed to be UTF-8. Because Zig source code is UTF-8 4 *const [5:0]u8 5 5 6 e 7 0 8 true 9 128169 10 128175 11 true 12 0xff 13 ⚡ See also: Arrays Source Encoding Escape Sequences Escape Sequences Escape Sequence Name \n Newline \r Carriage0 码力 | 239 页 | 8.03 MB | 1 年前3
The Zig Programming Language 0.4.0 DocumentationValues Floats Float Literals Floating Point Operations Operators Table of Operators Precedence Arrays Vectors SIMD Pointers volatile Alignment allowzero Slices struct extern struct packed struct Casts Implicit Cast: Stricter Qualification Implicit Cast: Integer and Float Widening Implicit Cast: Arrays and Pointers Implicit Cast: Optionals Implicit Cast: Error Unions Implicit Cast: Compile-Time Known Optionals undefined String Literals and Character Literals String literals are UTF-8 encoded byte arrays. Character literals have type comptime_int, the same as Integer Literals. All Escape Sequences are0 码力 | 207 页 | 5.29 MB | 1 年前3
The Zig Programming Language 0.3.0 Documentationtes[5] == 0); } $ zig test test.zig Test 1/1 string literals...OK All tests passed. See also: Arrays Zig Test Escape Sequences Escape Sequence Name \n Newline \r Carriage Return \t Tab \\ Backslash otherwise returns false. Invokes Peer Type Resolution for the operands. (1 <= 2) == true a ++ b Arrays Array concatenation. Only available when a and b are compile- time known. const mem = @import(" @import(" const array1 = []u32{ const array2 = []u32{ const together = arra mem.eql(u32, together a ** b Arrays Array multiplication. Only available when a and b are compile- time known. const mem = @import("0 码力 | 175 页 | 4.08 MB | 1 年前3
共 45 条
- 1
- 2
- 3
- 4
- 5













