0
Why we use template .....if we can simply create function of same.
template
2 Answers
+ 1
If you want a function which can takes an int or a float as argument you can use template instead of write two same functions.
+ 2
instead of writing same function for many different data types, you just write it once with templates
you save time and size of code