Beginner
C++
Q18 / 100
What is a template in C++?
Correct! Well done.
Incorrect.
The correct answer is B) A mechanism for writing generic code that works with any type
B
Correct Answer
A mechanism for writing generic code that works with any type
Explanation
Templates allow writing type-generic functions and classes. template<typename T> T max(T a, T b) works for any comparable type T.
Progress
18/100