I have a function like the below. I ran into a problem were i accidentally passes in enums when i wanted the value. Same problem would occur if i passed in structs or classes.
Is there a way i can pass call the func and only have strings and ints as my arguments?
static public string Func(string fmt, params object[] args)
You can create a paramarray of a specific type.
If you want to accept two different types, you can create a class with implicit conversions from
intandstringand accept a paramarray of that class.