Which keyword introduces a generic function or class in C++?
-
A
generic
-
B
typename class
-
C
virtual
-
D
template
Correct answer
Correct answer
D. template
11 views
Explanation
template lets the same code work for different types through generic parameters.
Reference
Asked in: NTS, PPSC IT, Campus Interviews
Doubts & discussion
Not sure why the answer is D? Ask here and get an explanation.
Ask a doubt about this MCQ