What is a template?

Showing Answers 1 - 1 of 1 Answers

samiksc

  • Jan 23rd, 2006
 

A template is a specification of the functionality without any consideration or binding of variables to a particular data type. It is the most abstract form of programming and generalizing.

For example an array functionality (storing elements, inserting, deleting, printing elements) is going to be the same whether you are storing integers, floats or strings or user defined data types. So a template may be written which will cover the basic functionalitites of array like shifting of an array for inserting an element at a middle position, deletion logic (again shifting of elements to cover the free slot created by deletion). Later each data type class will implement its own version of the array template to cover modifications specific to the data type.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions