Interview Questions Answers.ORG
Interviewer And Interviewee Guide
Interviews
Quizzes
Home
Quizzes
Interviews C Plus Plus Language Interviews:C++ Access ControlC++ COM ActiveXC++ ConstructorsC++ ContainersC++ Exception HandlingC++ FriendC++ InheritanceC++ Inline FunctionC++ New And DeleteC++ Operator OverloadingC++ Pointers & FunctionsC++ ProgrammerC++ ReferencesC++ Static DataC++ SyntaxC++ TemplateC++ Type CheckingC++ Virtual Functions
Copyright © 2018. All Rights Reserved
C++ Template Interview Question:
Tell me what are the syntax and semantics for a function template?
Submitted by: AdministratorTemplates 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: Administrator
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: Administrator
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.