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…
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…
I had a DataGridView in my Windows Form Application with an editable column, This editable column is to get populated with a priority number which I declared as a short in the code. On the DataGridView.CellValueChanged event, I get the…
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…
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…
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…
First of all, the question arises,Can a computer have more than one IP? If a computer is connected to one network, then it can have only one unique IP Address. But if a computer is connected to more than one…
Suppose we have 2 Lists of Products, and we want to make it one List. List<Product> products1 = GetProducts(cid1); List<Product> products2 = GetProducts(cid2); One way is to iterate the 2nd List, and add all elements to the 1st List, or iterate both…

In C# the ‘@‘ character is used to denote literals that explicitly do not adhere to the relevant rules in the language specification. If we use a keyword as the name for an identifier, we get a compile-time error “identifier expected,…

We cannot have a static method inside an interface, like below: public interface Foo { public static int bar(); // compile time error } This will be a compile time Error saying: The modifier ‘static’ is not valid for this…

Removing elements from List<> while iterating over the List, someone may simply try: foreach(char c in list) { list.Remove(c); } But, When we execute this code, we will get System.InvalidOperationException with the message “Collection was modified; enumeration operation may not execute.” The reason is: The…