In C++, if I overload a function like the following
void foo(int bar);
void foo(int bar, float baz = 0);
And then I call it
foo(1);
Which foo would be called?
In C++, if I overload a function like the following
void foo(int bar);
void foo(int bar, float baz = 0);
And then I call it
foo(1);
Which foo would be called?
I tried, and it won't compile as David Haim said in his comment to my question.
Why would you even need the first? Seems redundant. The first one will be hit. This is a duplicate. Check here for answer.