Answers for "writing template c++"

C++
1

template in c++

template <typename T>
void Swap(T &n1, T &n2)
{
	T temp;
	temp = n1;
	n1 = n2;
	n2 = temp;
}
Posted by: Guest on October-29-2020
0

how to write a template c++

template <class myType>
myType GetMax (myType a, myType b) {
 return (a>b?a:b);
}
Posted by: Guest on October-24-2020

Browse Popular Code Answers by Language