Is there a way to get o1
variable type during runtime instead of the instance type it is referencing?
o1.GetVariableType
or something like that which returns the compile-time static type of the variable? In o1's case, System.Object
rather than System.Double
?
Thanks.
{
double? d1 = 4.4;
object o1 = d;
Console.WriteLine(d1.GetType());
Console.WriteLine(o1.GetType());
}
this prints out
System.Double
System.Double
Edit: Scheme posted the link that actually answered my question.