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
find the area of a curve y=f(x) between x=a and x=b integrate f(x) between limits a and b   #include float start_point, /* GLOBAL VARIABLES */

Assignment:  write a C program and a MASM procedure.  The C program calls the MASM procedure to perform letter case conversion. Text sections covered:  12.1 to 12.3.1 Write a

how many types of loops are there and whay are they and what are its uses

Program to sort a range of numbers with Insertion: /* define variable */ const int max=29000; int list[max]; FILE *fp; clock_t start,end; char any1[8];


how can I find the GCD of 2 given numbers using Euclidean Algorithm ?


flow chart for prime or not

How can one make it so keys pressed through users are not echoed on the screen? A: It is not a standard C++ feature. C++ doesn't even need your system to have a keyboard or a sc

#include stdio.h #include math.h float discharge(float,float); void main()   {   char prompt;      float time,out,cr;   cr = 100e-6;   for (time = 0;time   {   /* call th