To maintain type safety and security, by default C# does not support pointer arithmetic. However, by using the unsafe keyword, it is possible to define an unsafe context in which pointers can be used. For more information about pointers, see the topic Pointer types.
Unsafe Code Overview
Unsafe code has the following properties:
Methods, types, and code blocks can be defined as unsafe.
In some cases, unsafe code may increase an application's performance by removing array bounds checks.
Unsafe code is required when calling native functions that require pointers.
Using unsafe code introduces security and stability risks.
In order for C# to compile unsafe code, the application must be compiled with /unsafe.
No comments:
Post a Comment