FreePrograms


  CONTACT US   ABOUT US   PRIVACY  DISCLAIMER

FREE C PROGRAMS 

What is C C vs C++ vs Java Program Structure Data Types in C Basic Rules of C & C++
Functions in C If, Else Conditions Loops in C Switch Case Arrays
Pointers Structures in C Strings in C Command Line Arguments Type Casting
Linked Lists Recursion Binary Trees Inheritance Multiple Inheritance
Templates File I/O Object Oriented Programming Data Structures in C C interview Questions

Templates : C Language Tutorial

.
.

Templates allow functions and classes to operate with generic types. These are used in container classes.

The format for declaring function templates is as follows:

template <class identifier> function declaration;

template <typename identifier> function declaration;
 

Example:

template <class V>
class vi {
    V numbr [2];
  public:
    vi (V first, V second)
    {
      numbr[0]=first; numbr[1]=second;
    }

 

COPYRIGHT 2009 ALL RIGHTS RESERVED FREECPROGRAMS.COM