How to convert function into a template


Discussion:

Q: The following function compares integers of type int and gives as a result the smaller number.

int min (int a , int b)
{
If (a < b)
Return a;
Else
Return b;

}

Convert this function to a C++ template.

 

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: How to convert function into a template
Reference No:- TGS01937103

Now Priced at $20 (50% Discount)

Recommended (91%)

Rated (4.3/5)