What are templates? where we should use it?

Answer Posted / satheeshkumar

Template allow us to write one function and class that
works for different datatype .

Use :

Create a type safe collection class that can operate on
data of any type.

add extra type checking for function.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the full form of india?

568


What is vector processing?

669


How do you remove an element from a set in c++?

582


What is an arraylist c++?

687


How do I run a program in notepad ++?

601






If a round rectangle has straight edges and rounded corners, your roundrect class inherits both from rectangle and from circle, and they in turn both inherit from shape, how many shapes are created when you create a roundrect?

667


Why we use #include conio h in c++?

595


Can c++ do everything c can?

601


What is the difference between the functions memmove() and memcpy()?

632


Is c++ a programming language?

594


What is set in c++?

660


What does it mean to declare a destructor as static?

625


What are the four partitions in which c++ compiler divides the ram?

700


Mention the ways in which parameterized can be invoked.

540


If a function doesn’t return a value, how do you declare the function?

616