+ 2
Benifits of function overloading in c++ program?
why we need function overloading in c++ ? or what are the benifits of function overloading in c++ program?
2 Answers
+ 3
@Jonathan _ answer is sound and clear, you should keep what he said in mind
A little more technical but you ABSOLUTELY NEED function overloading with variadic templates. I will not explain them here because they are quite complex. If you want an explanation about them,ask and I'll tell you but just know that you need a good understanding of classical templates to start learning variadic ones
+ 2
If you want to create a function to add a e.g. Date, you can overload a function addDate(Date date), and another one addDate(int day, int month, in year)
This way you can either add a date-struct or the date by single values.