What is Fixed Keyword in C#?

 Posted by vishalneeraj-24503 on 9/5/2014 | Category: C# Interview questions | Views: 1372 | Points: 40

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 

Comments or Responses

Login to post response