Introduction to Generic Classes






This video tutorial explains about the generic classes in c++ programming.
You are gonna learn how to define a generic class, how to pass generic types to generic class, how to create objects from a generic class, how to specify the datatypes for the objects created from a generic class, how to use the generic classes or template classes in detail with example.

source code for this tutorial

#include 

using namespace std;

template class MyClass{
MYTYPE p1;
MYTYPE p2;

public:
    MyClass(MYTYPE x,MYTYPE y){
    p1 = x;
    p2 = y;
    }

    void whatYouGot(){
    cout << "i got p1 = "<
                  
Back To Top