G
Guest
Hello,
I have a function that takes variable number of parameters -
[ParamArray]Object* args[]. In the function, I need to iterate through args
and find those arguments that can be converted (implicitly or explicitly) to
double, e.g. integers and doubles themselves. If the conversion is possible
I'd like to get the double value of that object. How to do that?
Besides double, I'm interested to know if an object is DateTime or String
type. In such cases, I think I have to use a construct like this:
if (args->GetType() == __typeof(String))
{
String* s = args->ToString();
}
I wonder, if there's a more effective way to do this, besides of caching the
return value of __typeof(String) in a variable.
I have a function that takes variable number of parameters -
[ParamArray]Object* args[]. In the function, I need to iterate through args
and find those arguments that can be converted (implicitly or explicitly) to
double, e.g. integers and doubles themselves. If the conversion is possible
I'd like to get the double value of that object. How to do that?
Besides double, I'm interested to know if an object is DateTime or String
type. In such cases, I think I have to use a construct like this:
if (args->GetType() == __typeof(String))
{
String* s = args->ToString();
}
I wonder, if there's a more effective way to do this, besides of caching the
return value of __typeof(String) in a variable.