Category: C#

Distinction between output and reference parameter

>>output parameter do not need to initialize before the passed to the method.it must assign when before  exiting the method calling. >>reference parameter must assign the before passed to the method. The reason is that passing the reference to an existing variable. If not assign works as unassigned variable. // Returning multiple output parameters. static void FillTheseValues(out int a, out string… Read more →

volatile in .net vb and C#

http://msdn.microsoft.com/en-us/library/x13ttww7.aspx The volatile modifier is usually used for a field that is accessed by multiple threads without using the lock statement to serialize access. The volatile keyword can be applied to fields of these types: Reference types. Pointer types (in an unsafe context). Note that although the pointer itself can be volatile, the object that it points to cannot. In other words, you cannot declare a… Read more →