CameraIcon
CameraIcon
SearchIcon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

A template can be used to create a family of

A
Classes
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
Functions
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
Class and function
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
D
None of these
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is C Class and function

A template can be used to create a family of Class and function.

Templates are a feature of the C++ programming language that allows functions and classes to operate with generic types. This allows a function or class to work on many different data types without being rewritten for each one.

Function templates:- In C++ this can be achieved using template parameters. A template parameter is a special kind of parameter that can be used to pass a type as argument: just like regular function parameters can be used to pass values to a function, template parameters allow to pass also types to a function.

Class template:- A class template by itself is not a type, or an object, or any other entity.



flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Tabular Presentation
STATISTICS
Watch in App
Join BYJU'S Learning Program
CrossIcon