what is the usage of clas templates

Answer Posted / saurabh chauhan

templates are used to create generic functions as well as
classes..which can support miltiple data types..
they are mainly used when algorithm is commom for diff data
types...so we dont hav to implement again and again for
diff data types ..we make a generic func. which works for
all...

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the real time example of encapsulation?

584


What is solid in oops?

592


Write a program to compute for numeric grades for a course. The course records are in a file that will serve as the input file. The input file is in exactly the following format: Each line contains a student's first name, then one space, then ten quiz scores all on one line. The quiz scores are in whole number and are separated by one space. Your program will take it input from this file and sends it output to a second file. The data in the output file will be exactly the same as the data in the input file except that there will be one additional number (of type double) at the end of each line. This number will be the average of the student's ten quiz scores. Use at least one function that has file streams as all or some of its arguments.

2565


What are classes oop?

589


What is Difference Between Inheritance and creating object and getting data? means Class A extends B{ B.getMethod();} (OR) Class A{ b obj=new B(); obj.getMethod(); }

1971






What is oops in simple words?

571


What are the 3 pillars of oop?

607


What is coupling in oops?

587


Why oops is important?

597


What is difference between multiple inheritance and multilevel inheritance?

593


which feature are not hold visual basic of oop?

1713


How to handle exception in c++, For example in a functions i am assigning memory to some variables and also in next instructions in am dividing one variable also. If this functions generates a error while allocating memory to those variable and also while dividing the variable if i divide by zero then catch block how it will identify that this error has cone from perticular instruction

1646


What is overriding vs overloading?

573


Will I be able to get a picture in D drive to the c++ program? If so, help me out?

1644


What do you mean by abstraction?

603