template <class ttype>
ttype multiply(ttype a, ttype b)
{
return a * b;
}
int * int doesn't always fit in an int. C++ Templates: The Definitive Guide suggests using a traits class to solve problems like this. Templates are a complex subject in general, and I wouldn't recommend using them without having read the aforementioned book.