Lets say I want to get the default value for a system type... how would I
implement the following function:
public object DefaultValueOfType(Type t)
{
return ????;
}
I want to be able to call it like this:
DefaultValueOfType(typeof(string));
DefaultValueOfType(typeof(int));
DefaultValueOfType(typeof(double));
I have tried:
return t.TypeInitializer.Invoke(null);
but it says "Type initializer is not callable."
-mdb