If I got this function, fun(t1, t2, t3), and I call it by fun(v1, v2), is it possible to get a default value for v3 though it hasn’t been specified what that would be? Such as bool being false, pointer being null, int being 0 etc. Or should that raise compiler error?
Share
It will raise a compiler error if the function isn’t overloaded.
If you can’t change the prototype, you can overload it yourself:
or if you can change it, you can declare a default for the parameter like this: