Writing unsafe code
In this section, we will discuss introduction to how to write unsafe code using Visual Studio. Language C# provides a way to write code which compiles and creates the objects and these objects under the root are managed by the garbage collector [refer to day 01 for more details on garbage collector]. In simple words, C# is not like C, C++ language which use concept of function pointer to access references. But there is a situation when it is necessary to use function-pointers in C# language similar to languages that support function-pointers like C or C++ but C# language does not support it. To overcome such situations, we have unsafe code in C# language. There is modifier unsafe which tells that this code is not controlled by Garbage collector and within that block we can use function pointers and other unsafe stuffs. To use unsafe code, we first inform compiler to set on unsafe compilation from Visual Studio 2017 or later just go to project properties and on Build
tab...