Farhan Sarwar

Farhan Sarwar

What is a Static Constructor in C#

A static constructor is a way to initialize any static data or to perform a particular action that needs to be performed only once. A static constructor is called automatically before the first instance is created or any static member is referenced.…

Call C++ Native code from C#

Calling C++ Native (Unmanaged) code from (Managed) C# code: C# can call C++ code only if C++ code is a DLL (Dynamic Link Library).Create a C++ project in Visual Studio and change its type to a DLL.Here is what you…

Difference between ref and out keywords in C#

ref and out are pretty much like the pointers as in C/C++, they deal with the memory location of the object instead of the object directly.Mostly ref and out keywords are used in the method’s parameters ref void myFunction(ref Student obj); ref means that…

What is GUID

GUID stands for Globally Unique Identifier. GUID is the Microsoft implementation of the Distributed Computing Environment (DCE) Universally Unique Identifier(UUID). A GUID is a 128-bit value consisting of one group of 8 hexadecimal digits, followed by three groups of 4…

What is the Maximum Capacity of a String in .NET

The theoretical capacity of a String maybe 2,147,483,647 (2 Billion), because the Length property of the String returns an int, so the maximum length of a String is Int32.MaxValue (2,147,483,647) characters. But in practical, Since no single object in a .NET…