When is a template better solution than a base class??

Answer Posted / mayank kumar

as template is in form of generic class and generic
function so here the class and function works for all. also
in template we can change the data type of function
parameter as well as of the data member present in class.

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the benefit of encapsulation?

596


To what does “event-driven” refer?

615


What is the array and initializing arrays in c++?

510


Explain function overloading and operator overloading.

626


Why do we use the using declaration?

664






Write a program using shift_half( ) function to shift the elements of first half array to second half and vice versa.

794


What is the first name of c++?

569


What do you mean by function and operator overloading in c++?

613


How is new() different from malloc()?

635


What is namespace & why it is used in c++?

610


What is a volatile variable in c++?

563


Which programming language should I learn first?

581


Is java as fast as c++?

603


What jobs can you get with a c++ certification?

588


Where are setjmp and longjmp used in c++?

626