| 1. |
What is UnSafe Code? |
|
Answer» In ORDER to maintain security and type safety, C# does not support pointer generally. But by using unsafe keyword we can define an unsafe context in which pointer can be used. The unsafe code or unmanaged code is a code block that uses a pointer variable. In the CLR, unsafe code is referred to as unverifiable code. In C#, the unsafe code is not necessarily dangerous. The CLR does not verify its safety. The CLR will only execute the unsafe code if it is within a fully trusted assembly. If we use unsafe code, it is our own responsibility to ensure that the code does not introduce security RISKS or pointer errors. Unsafe code cannot be executed in an un-trusted environment. For example, we cannot run unsafe code directly from the Internet Some properties of unsafe codes are given bellow:
|
|