What is a template in C++? And why is it used?How to make a relationship between template and member function?Give examples and explain in brief
50 points for correct answer
and wrong answer will be deleted immediately
Answers
Answered by
3
HEYA MATE ❤❤
Templates are powerful features of C++ which allows you to write generic programs. In simple terms, you can create a single function or a class to work with different data types using templates. Templates are often used in larger codebase for the purpose of code reusability and flexibility of the programs.
Function templates are special functions that can operate with generic types. This allows us to create a function template whose functionality can be adapted to more than one type or class without repeating the entire code for each type. In C++ this can be achieved using template parameters.
Answered by
9
Sorry Mate I can't I Don't Know about that.
Similar questions
Computer Science,
7 months ago
Geography,
7 months ago
Computer Science,
7 months ago
Math,
1 year ago