what is the usage of clas templates
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / anil kumawat
through this we can make generic function. so this function
will work for any data type.
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / anil bisht
A template is a C++ feature that allows functions and
classes to be defined with any type.Class template is a
template used to generate template classes. You cannot
declare an object of a class template.Template class is an
instance of a class template.
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / james prasanna.j
We can able to operate "class template" functionalities in
generic way, which supports different data types.
| Is This Answer Correct ? | 3 Yes | 2 No |
Answer / keshav.gadde
Template is a mechanism that allows one function or class to
deal with diffrent data types.
Using templates we can design a template class that operates on
diffrent data types.
| Is This Answer Correct ? | 0 Yes | 1 No |
Difference ways of Polymorphism?
What is for loop and its syntax?
What is namespace?
class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash
Why multiple inheritance is not allowed?
What is polymorphism explain?
What is the correct syntax for inheritance? 1) class aclass : public superclass 2) class aclass inherit superclass 3) class aclass <-superclass
any one please tell me the purpose of operator overloading
what is opps?why it is use in programming language?
What is Agile methodology?
20 Answers ABC, Accenture, College School Exams Tests, Inmar, Microsoft, Sapient,
WAP find square root of any number (without using sqrt() )?
advantage and disadvantage in c++>>oops and what are the questions ask for interview in c++>>oops. could you tell me or reply me