.
[9]: 9
.
*(+0): 0 *(P+1): 1 *(+2): 2 *(+3): 3 *(+4): 4
* (+5): 5
* (+6): 6
* (+7): 7 *(+8): 8
* (+9): 9
,
* (ptr + i)
.
ptr[i]
, . -, . . -, Length, . , , .
C# ^. . char* fixed.
fixed(char* = str) { //...
fixed , . , .. . . C/C++ , , , char* , , C/C++.
, char*.
// fixed // .
Using System;
class FixedString {
unsafe static void Main() { string str = " ";
// str. fixed(char* = str) {
// str . for(int i=0; p[i]!= 0; i++)
Console.Write(p[i]);
Console.WriteLine();
}
}
.
, , , . , . , , . . 20.1. , , . , , , .
-►
-► -►
|
|
. 20.1. -
, . .
, , . * . , , q int.
int** q;
, , , q , int.
, , *, .
Using System;
class Multiplelndirect {
unsafe static void Main() {
int x; // int
int* p; // int
int** q; // int
= 10;
= &; // q = &; // q
Console.WriteLine(**q); //
}
}
10 . int, q int.
: , , .