What is a template in c++, C/C++ Programming

Templates permit to create generic functions that admit any data type as parameters and return value without having to overload the function with all the possible data types. Until particular point they fulfil the functionality of a macro. Its prototype is any of the two following ones:

template function_declaration; template function_declaration;

The only difference among both prototypes is the use of keyword class or typename, its use is indistinct since both expressions have exactly the similar meaning and behave exactly the similar way.            

 

 

Posted Date: 4/8/2013 5:41:08 AM | Location : United States







Related Discussions:- What is a template in c++, Assignment Help, Ask Question on What is a template in c++, Get Answer, Expert's Help, What is a template in c++ Discussions

Write discussion on What is a template in c++
Your posts are moderated
Related Questions
Member Functions of a Class A member function of the class is similar as an ordinary function. Its declaration in a class template must explain its return value as well as the

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b


In this problem you are given a board in which some of the elements are placed as shown in diagram below. Each element represents a color. Fill the other elements in the board, suc

Explain about the strategies of implementation of the statecharts, Database Management System?

You're going to simulate a metropolitan subway train.  The train system will start out at Station #1, or Home  Station, and will service multiple stations along its route.

Write a program to calculate the average of ten numbers       #include stdio.h     /* Only this header is needed since only IO are used */     void main()     {          char

Is it possible to have Virtual Constructor? If yes, how? If not, Why not possible?

how many values we can return from pointer to function?

Define the Arithmetic Operators in c Language? There are five arithmetic operators in C and they are Operator             Purpose +                        Addition -