The Mighty C++ Template
(Page 1 of 9 )
One of the biggest advantages of using C++ is templates. Templates were designed from the ground up to allow developers to write one function to handle many different types of parameters. In this article, Mitchell will explain what both function and class templates are, and give examples of each.One of the biggest advantages of using C++ is templates. Templates were designed from the ground up to allow developers to write one function to handle many different types of parameters. Because C++ is a strongly typed language (ie: You must declare a variable before you can reference it), each and every function you create must specify the data type of each parameter it accepts and also the data type of its return value, such as int, bool, char, string, etc.
Next: Understanding function overloading >>
More C++ Articles
More By Mitchell Harper