Answer: Fixed is the one of uncommon keyword in C#. The keyword Fixed which can only be used in
Unsafe C# code blocks.
Fixed statement sets the pointer to be in a fixed memory address so that,it will not be moved to anywhere even if Garbage Collection Thread is invoked.We have to use Fixed keyword.
For Example:-
fixed (char* pointer = 1)
{
//Our code
}
Asked In: Many Interviews |
Alert Moderator