Friday, 27 April 2012

Program Of Template Function In C++


#include<iostream.h>
#include<conio.h>
template<class T>
{
result =(a>b) ? a : b;
return(result);
}
 main()
{
clrscr();
int i=5,j=6,k;
long l=5,m=10,n;
k=getmax(i,j);
n=getmax(l,m);

cout<<k<<endl;
cout<<n<<endl;
getch();

}

No comments:

Post a Comment