Technical Discussion :: C++
Home > Technical Interview Q&A > C++ > Discussion
110 / 187
Explain non-type template arguments?
Answer:
It is also possible to use nontype arguments that are in additional argument T, we can also use other arguments such as strings, function names, constant expressions and built-in types.
Ex:
Template
Class array
{
T a[size];
……..
……..
};
this templates supplies the size of the array as an argument.
Asked In ::
Manjeet
23 Feb, 2019 5:07 AM
It is also possible to use nontype arguments that are in additional argument T, we can also use other arguments such as strings, function names, constant expressions and built-in types.
Ex:
Template
Class array
{
T a[size];
……..
……..
};
this templates supplies the size of the array as an argument.
Ex:
Template
Class array
{
T a[size];
……..
……..
};
this templates supplies the size of the array as an argument.