Examveda

What does this template function indicates?
==================
template<class T, class U>
U func(T a, U b)
{
	cout<<a<<"\t"<<b;
}
==================

A. A function taking a single generic parameter and returning a generic type which may be different from argument type

B. A function taking a single generic parameter and returning a generic type which must be different from argument type

C. A function taking a single generic parameter and returning a generic type which must have the same type as argument type

D. A function taking a single generic parameter and returning a specific non-void type

Answer: Option A


Join The Discussion

Related Questions on C plus plus miscellaneous

What is the difference between '++i' and 'i++' in C++?

A. None of the above

B. They both have the same effect

C. '++i' increments the value of 'i' before returning it, while 'i++' increments the value of 'i' after returning it

D. '++i' increments the value of 'i' after returning it, while 'i++' increments the value of 'i' before returning it