Define the syntax and semantics for a function template?
Submitted by: MurtazaTemplates is one of the features of C++. Using templates, C++ provides a support for generic programming.
We can define a template for a function that can help us create multiple versions for different data types.
A function template is similar to a class template and it syntax is as follows:
template <class T>
Return-type functionName (arguments of type T)
{
//Body of function with type T wherever appropriate
}
Submitted by: Murtaza
We can define a template for a function that can help us create multiple versions for different data types.
A function template is similar to a class template and it syntax is as follows:
template <class T>
Return-type functionName (arguments of type T)
{
//Body of function with type T wherever appropriate
}
Submitted by: Murtaza
Read Online C++ COM ActiveX Job Interview Questions And Answers
Top C++ COM ActiveX Questions
☺ | What is ActiveX? |
☺ | What is OLE? |
☺ | What is STL, standard template library? |
☺ | What is object serialization? |
☺ | What is Component Object Model? |
Top C Plus Plus Language Categories
☺ | C++ Pointers & Functions Interview Questions. |
☺ | C++ Operator Overloading Interview Questions. |
☺ | C++ Exception Handling Interview Questions. |
☺ | C++ Template Interview Questions. |
☺ | C++ Virtual Functions Interview Questions. |