A Template Function for Maximum
When you write a template function, you choose a data type for the function to depend upon...
template <class Item>
Item maximum(Item a, Item b)
{
if (a > b)
return a;
else
return b;
}
Previous slide
Next slide
Back to first slide
View graphic version