Line 45-47 is not asking quite right. I am returning the address but now to sure why. I defined it as a char and I might be very new to Templates but I thought this is how they are suppose to work.....
Code:
#include <iostream>
using namespace std;
template <class T>
class display {
private:
T first;
T second;
public:
display(T a, T b)
:first(a), second(b)
{ }
T largest();
T characters();
T sentence();
};
template<class T>
T display<T>::largest()
{
return first>second?first:second;
}
template<class T>
T display<T>::characters()
{
return first + second;
}
template<class T>
T display<T>::sentence()
{
return first + second;
}
int main()
{
cout<<"The largest value will be displayed\n";
display<int>HW(22,45);
cout<<HW.largest()<<endl;
cout<<"\nUsing a Template we will combine two Char's\n";
display<char>HW1('H','W');
cout<<HW1.characters()<<endl;
cout<<"\nUsing a Template we will combine two String's\n";
display<string>HW2("Home"," Work");
cout<<HW2.sentence()<<endl;
return 0;
}