The Zig Programming Language 0.12.0 Documentationmantissa) IEEE-754- 2008 binary128 bool bool true or false anyopaque void Used for type-erased pointers. void (none) Always the value void{} noreturn (none) the type of break , continue , return , unreachable undefined String Literals and Unicode 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 fact that they are null-terminated, and thus they can be coerced to both Slices and Null-Terminated Pointers. Dereferencing string literals converts them to Arrays. Because Zig source code is UTF-8 encoded0 码力 | 241 页 | 7.37 MB | 1 年前3
The Zig Programming Language 0.7.1 DocumentationOptionals undefined String Literals and Character Literals String literals are single-item constant Pointers to null-terminated UTF-8 encoded byte arrays. The type of string literals encodes both the length that they are null- terminated, and thus they can be coerced to both Slices and Null-Terminated Pointers. Dereferencing string literals converts them to Arrays. Character literals have type comptime_int y += 1; ^ const applies to all of the bytes that the identifier immediately addresses. Pointers have their own const-ness. If you need a variable that you can modify, use the var keyword: test0 码力 | 225 页 | 5.74 MB | 1 年前3
The Zig Programming Language 0.6.0 DocumentationOptionals undefined String Literals and Character Literals String literals are single-item constant Pointers to null-terminated UTF-8 encoded byte arrays. The type of string literals encodes both the length that they are null- terminated, and thus they can be coerced to both Slices and Null-Terminated Pointers. Dereferencing string literals converts them to Arrays. Character literals have type comptime_int y += 1; ^ const applies to all of the bytes that the identifier immediately addresses. Pointers have their own const-ness. If you need a variable that you can modify, use the var keyword: test0 码力 | 214 页 | 5.37 MB | 1 年前3
The Zig Programming Language 0.4.0 DocumentationLiterals Floating Point Operations Operators Table of Operators Precedence Arrays Vectors SIMD Pointers volatile Alignment allowzero Slices struct extern struct packed struct struct Naming enum extern Optional Type null Optional Pointers Casting Implicit Casts Implicit Cast: Stricter Qualification Implicit Cast: Integer and Float Widening Implicit Cast: Arrays and Pointers Implicit Cast: Optionals Implicit Zero Bit Types Implicit Cast: undefined Explicit Casts Peer Type Resolution Zero Bit Types void Pointers to Zero Bit Types comptime Introducing the Compile-Time Concept Compile-Time Parameters Compile-Time0 码力 | 207 页 | 5.29 MB | 1 年前3
The Zig Programming Language 0.9.1 Documentationmantissa) IEEE-754-2008 binary128 bool bool true or false anyopaque void Used for type-erased pointers. void (none) 0 bit type noreturn (none) the type of break , continue , return , unreachable , undefined String Literals and Unicode 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 fact that they are null-terminated, and thus they can be coerced to both Slices and Null-Terminated Pointers. Dereferencing string literals converts them to Arrays. The encoding of a string in Zig is de-facto0 码力 | 234 页 | 7.90 MB | 1 年前3
The Zig Programming Language 0.8.1 Documentationundefined String Literals and Unicode 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 fact that they are null-terminated, and thus they can be 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 y += 1; ^ const applies to all of the bytes that the identifier immediately addresses. Pointers have their own const-ness. If you need a variable that you can modify, use the var keyword: test0 码力 | 234 页 | 6.01 MB | 1 年前3
The Zig Programming Language 0.5.0 DocumentationOperations Operators Table of Operators Precedence Arrays Multidimensional Arrays Vectors SIMD Pointers volatile Alignment allowzero Slices struct Default Field Values extern struct packed struct struct Optional Type null Optional Pointers Casting Implicit Casts Implicit Cast: Stricter Qualification Implicit Cast: Integer and Float Widening Implicit Cast: Arrays and Pointers Implicit Cast: Optionals Zero Bit Types Implicit Cast: undefined Explicit Casts Peer Type Resolution Zero Bit Types void Pointers to Zero Bit Types Result Location Semantics usingnamespace comptime Introducing the Compile-Time0 码力 | 224 页 | 5.80 MB | 1 年前3
The Zig Programming Language 0.11.0 Documentationmantissa) IEEE-754-2008 binary128 bool bool true or false anyopaque void Used for type-erased pointers. void (none) Always the value void{} noreturn (none) the type of break , continue , return , unreachable 5.3. String Literals and Unicode 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 fact that they are null-terminated, and thus they can be coerced to both Slices and Null-Terminated Pointers. Dereferencing string literals converts them to Arrays. The encoding of a string in Zig is de-facto0 码力 | 238 页 | 7.80 MB | 1 年前3
The Zig Programming Language 0.10.1 Documentationmantissa) IEEE-754-2008 binary128 bool bool true or false anyopaque void Used for type-erased pointers. void (none) Always the value void{} noreturn (none) the type of break , continue , return , unreachable undefined String Literals and Unicode 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 fact that they are null-terminated, and thus they can be coerced to both Slices and Null-Terminated Pointers. Dereferencing string literals converts them to Arrays. The encoding of a string in Zig is de-facto0 码力 | 239 页 | 8.03 MB | 1 年前3
The Zig Programming Language 0.1.1 Documentationconst mem = @import("std").mem; const pattern = "ab" ** 3; mem.eql(u8, pattern, "ababab") *a Pointers Pointer dereference. const x: u32 = 1234; const ptr = &x; *x == 1234 &a All types Address of. initalization...OK Test 4/4 array initialization with function calls...OK See also: for Slices Pointers const assert = @import("std").debug.assert; test "address of syntax" { // Get the address == &i32); *y_ptr += 1; assert(*y_ptr == 5679); } test "pointer array access" { // Pointers do not support pointer arithmetic. If you // need such a thing, use array index syntax:0 码力 | 82 页 | 2.67 MB | 1 年前3
共 37 条
- 1
- 2
- 3
- 4













