Generic Class with more than one Generic Type
This video tutorial explains the generic classes which are gonna work with more than one generic type.
You are gonna learn how to create a generic class which is gonna operate on more than on generic type, how to use multiple generic types with generic class in your program, how to create objects from the generic classes with multiple generic types in detail with example.
source code for this tutorial
#includeusing namespace std; template class MyClass{ Type1 p1; Type2 p2; int counter; public: MyClass(Type1 x, Type2 y){ p1 = x; p2 = y; counter = 100; } void whatYouGot(){ cout << "i got p1 = "< ob1(24,"anil"); MyClass ob2(22.36,66.241); ob1.whatYouGot(); ob2.whatYouGot(); return 0; }