by Murray | Jul 1, 2009 | .NET, C#, Programming
When using variables in C# you need to be aware of and careful with boxing and unboxing. For example the following code; int discount = 20; object discPerc = discount; discount = 15; int discPercent = (int)discPerc; In this instance the value of discount is 15 but the...