Using templates programmers can create abstract classes that define the behavior of the class without actually knowing what data type will be handled by the class operations. Such classes are known as class templates. Syntax for creating a class template is as follows: 1 2 3 4 5 6 7 template<class Type1, class Type2, ...> class ClassName { ... //Body of the class ... }; Syntax for creating an object of the template class is as follows: 1 ClassName<Type> ObjectName(params–list); The process of creating an object of a template class or creating a specific class from a class
The post What are the templates of the Class in C++ Programming appeared first on Coding Security.
What are the templates of the Class in C++ Programming
read more
Tidak ada komentar:
Posting Komentar