what is the use of templates?

Answer Posted / aboelella

Template is used to optimize code
instead of implementing the same code for multiple data
types, template works as a way to declare classes and
functions and then to be implemented with different data types

It is dependent on the data structure used to substitute the
template

Is This Answer Correct ?    18 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is fixed in c++?

582


Explain dangling pointer.

674


Which is best c++ or java?

606


Which is the best c++ software?

606


True or false, if you keep incrementing a variable, it will become negative a) True b) False c) It depends

1855






What are arrays c++?

605


Why is standard template library used?

579


Can member functions be private?

593


What is meant by const_cast?

647


Who created c++?

576


Why namespace is used in c++?

598


Explain this pointer?

579


What kind of jobs can I get with c++?

593


Is c++ a high level language?

548


What do you mean by global variables?

570