21. pointer operation
In C #, pointer operations can be used in Methods labeled as unsafe modifiers. When the pointer points to an object that can be garbage collected, the compiler forces the fixed keyword to fix the object. This is because the Garbage Collector recycles memory by moving objects. However, if you use the original pointer and the object it refers to is moved, your pointer will point to garbage. I think using the keyword "unsafe" is a good choice-it does not encourage developers to use pointers unless they really want to do so.
22. Multi-dimensional array
C # You can create an interleaved array. The dimensions and sizes of the elements in the staggered array can be different] and multi-dimensional arrays. The staggered array is very similar to the Java array. Multi-dimensional arrays allow you to express specific problems more effectively and accurately. The following is an example of this array:
Int [,] array = new int [3, 4, 5]; // create an array
Int [, 1] = 5; // This line of code is incorrect: array [, 1] = 5 ;]
Use an interleaved array:
Int [] [] [] array = new int [3] [4] [5]; // This line of code is incorrect and should be: int [] [] [] array = new int [3] [] [];]
Int [1] [1] [1] = 5; [: This line of code is incorrect: it should be array [1] [1] [1] = 5;] [: use the staggered array with caution]
If used in combination with the structure, the efficiency provided by C # Makes arrays a good choice in the graphic and mathematical fields.